Search GitHub code
github_search_codeSearch file contents across GitHub using a GitHub connection (your own or one shared with you). Accepts a GitHub code-search query (qualifiers like repo:, org:, language:, path:, filename: are supported and usually required). Returns up to 30 matching files.
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 |
|---|---|---|---|
| query | Yes | GitHub code search query, e.g. "addEventListener repo:octocat/Hello-World language:js". | |
| connection | No | Which GitHub connection to use, by its name from github_list_connections. This is a local label for the connection, NOT a GitHub username — for anything GitHub has to resolve, use that connection's login instead. Optional when you have exactly one. |