GitHub code search
github_search_codeSearch code across GitHub repositories by query, repo, or path to locate symbols and snippets, with pagination and caching; cross-check recent changes when results are incomplete.
Instructions
Search code across GitHub. Requires a token; GitHub allows this endpoint only 10 requests/minute and caps results at 1000. The repo: and path: qualifiers are parsed from query and re-injected at the end. Returns {total_count, incomplete_results, items[{repo, path, sha, html_url, text_matches}], page, per_page, has_more, next_page}. GitHub's search index lags fresh pushes; recently changed symbols may be missing — cross-check with github_file_grep or github_file.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"query": "<query>"
},
"name": "github_search_code"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | Page number, starting at 1 | |
| fresh | No | Bypass the local cache | |
| query | Yes | GitHub code search query | |
| per_page | No | Items per page, 1-100, default 20 |