search_code
Search for code within Git repositories to locate specific files and lines matching your query across branches or commits.
Instructions
Search for code in a repository. Returns matching files and lines.
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": {
"repo": "<repo>",
"query": "<query>"
},
"name": "search_code"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| repo | Yes | Repository identifier (GitLab: "group/project" or ID, GitHub: "owner/repo") | |
| query | Yes | Search query to find in code | |
| ref | No | Branch or commit to search in | |
| page | No | Page number (default: 1) | |
| per_page | No | Items per page (default: 20, max: 100) |