# Sourcegraph AI integration on Definable

> Sourcegraph is a code intelligence platform that enables developers to search, understand, and manage code across large codebases.

## What this connects

Sourcegraph is a code intelligence platform that enables developers to search, understand, and manage code across large codebases.

Vendor: https://sourcegraph.com/

## Tools available

**8** tools available. First 8:

- `SOURCEGRAPH_CHECK_SITE_SETTINGS_EDIT_PERMISSION` — Check Site Settings Edit Permission — Tool to check whether site settings can be edited through the API. Use when you need to confirm the API allows site settings edits before attempting configuration changes.
- `SOURCEGRAPH_COMPARE_COMMITS` — Compare Commits — Tool to compare two commits in a repository and retrieve their file diffs. Use after confirming the repository name and commit SHAs to inspect differences.
- `SOURCEGRAPH_GET_COMMIT_DETAILS` — Get Commit Details — Get detailed information about a specific commit in a repository.
- `SOURCEGRAPH_GET_CURRENT_USER` — Get Current User — Tool to retrieve information about the currently authenticated user. Use when needing confirmation of identity via Sourcegraph GraphQL API.
- `SOURCEGRAPH_GET_FILE_CONTENTS` — Get File Contents — Tool to fetch the contents of a specified file on the default branch. Use when you need raw file text without cloning the repo or using a slower code-host API.
- `SOURCEGRAPH_LIST_REPOSITORIES` — List Repositories — Tool to list repositories on the Sourcegraph instance. Use when you need to paginate through all available repositories.
- `SOURCEGRAPH_LIST_REPOSITORY_FILES` — List Repository Files — Tool to list all files and directories in a repository path. Use when you need to enumerate files in a repository without cloning.
- `SOURCEGRAPH_LIST_REPOSITORY_LANGUAGES` — List repository languages — Tool to list languages used in a repository. Use when you need to determine the primary and all languages of a given repository; call after you have the repository name.

## Auth

Auth schemes: `API_KEY`.

## How agents use Sourcegraph

Inside a Definable workflow, Sourcegraph is one of the tools the **Distributor specialist** can call. Example coordination patterns:

- **Researcher → Sourcegraph** — the Researcher (GPT-5.5) pulls context from Sourcegraph (records, threads, documents), synthesises findings, and briefs the rest of the team.
- **Writer → Distributor → Sourcegraph** — the Writer (Claude Opus 4.7) drafts copy in brand voice, the Verifier passes it, then the Distributor writes the result into Sourcegraph (create record, post message, draft email).
- **Designer / Engineer → Distributor → Sourcegraph** — the Designer ships an asset or the Engineer ships a code change, the Distributor delivers it via Sourcegraph (attach file, open PR comment, post status).

The Verifier checks every Sourcegraph call. On rate limit, schema drift, or auth refresh it self-heals and retries — the workflow completes without manual intervention.

## Categories

- developer tools — https://definable.ai/apps/category/developer-tools/

## Related

- HTML page: https://definable.ai/apps/sourcegraph/
- Same category (developer tools): https://definable.ai/apps/category/developer-tools/
- All integrations: https://definable.ai/apps/
- Workflow (multi-agent loop): https://definable.ai/workflow/
- Apps llms.txt index: https://definable.ai/llms-apps.txt
