Search code
search_codeSearch source code across public GitHub repositories and return matching files with short snippets; requires a GITHUB_TOKEN or PAT to work.
Instructions
Search source code in public repositories (GitHub requires a token for this endpoint, so it only works when GITHUB_TOKEN or GITHUB_PAT is set). Returns matching files with a short snippet.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | Limit to files under this path, e.g. 'src/' | |
| repo | No | Limit to one repository: 'owner/repo' | |
| limit | No | Number of results to return (1-100, default 10) | |
| owner | No | Limit to a user or organization | |
| query | Yes | Code or text to find, e.g. 'useSyncExternalStore' | |
| offset | No | Number of results to skip, for paging (default 0) | |
| filename | No | Exact file name, e.g. 'pom.xml' | |
| language | No | e.g. 'TypeScript' | |
| extension | No | File extension without dot, e.g. 'yml' |