# Sourcegraph

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

- **Category:** developer tools
- **Auth:** API_KEY
- **Composio Managed App Available?** N/A
- **Tools:** 8
- **Triggers:** 0
- **Slug:** `SOURCEGRAPH`
- **Version:** 20260227_00

## Tools

### Check Site Settings Edit Permission

**Slug:** `SOURCEGRAPH_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.

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Compare Commits

**Slug:** `SOURCEGRAPH_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.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `base` | string | Yes | Base commit SHA or ref to compare from |
| `head` | string | Yes | Head commit SHA or ref to compare to |
| `repo` | string | Yes | Repository name in format 'github.com/owner/repo' |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Commit Details

**Slug:** `SOURCEGRAPH_GET_COMMIT_DETAILS`

Get detailed information about a specific commit in a repository.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `rev` | string | Yes | Commit SHA, branch name, or tag to get details for |
| `repo` | string | Yes | Repository name in format 'github.com/owner/repo' |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Current User

**Slug:** `SOURCEGRAPH_GET_CURRENT_USER`

Tool to retrieve information about the currently authenticated user. Use when needing confirmation of identity via Sourcegraph GraphQL API.

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get File Contents

**Slug:** `SOURCEGRAPH_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.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `file_path` | string | Yes | Path to the file in the repository, relative to the root, e.g., 'README.md'. |
| `repo_name` | string | Yes | Full repository name, including host and path, e.g., 'github.com/uber/react-map-gl'. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List Repositories

**Slug:** `SOURCEGRAPH_LIST_REPOSITORIES`

Tool to list repositories on the Sourcegraph instance. Use when you need to paginate through all available repositories.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `after` | string | No | Pagination cursor returned from previous page; omit for first page. |
| `first` | integer | Yes | Number of repositories to retrieve (1-1000). |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List Repository Files

**Slug:** `SOURCEGRAPH_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.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `rev` | string | No | Git ref (branch, tag, or commit SHA). Defaults to HEAD. |
| `path` | string | No | Path within the repository. Defaults to root (''). |
| `recursive` | boolean | No | Whether to list files recursively. Defaults to True. |
| `repo_name` | string | Yes | Full repository name, e.g., 'github.com/owner/repo' |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List repository languages

**Slug:** `SOURCEGRAPH_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.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `repoName` | string | Yes | Full name of the repository (e.g., 'github.com/gorilla/mux'). |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |
