sourcegraph_search_code
Search code across multiple repositories using Sourcegraph. Apply operators like repo:, file:, lang:, and patterntype: to filter results precisely.
Instructions
Search code across repositories using Sourcegraph. Supports various search operators like repo:, file:, lang:, count:, patterntype:, etc.
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": "sourcegraph_search_code"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | The search query. Can include operators like "repo:owner/name", "file:path", "lang:python", "count:50", "patterntype:literal" (default), "patterntype:regexp", or "patterntype:structural". Examples: "payment count:50", "function handleRequest repo:myorg/myrepo", "func.*Handler patterntype:regexp" |