get_snippets
Return tailored code snippets for one or more symbols by name, without opening files. Use it after any graph-navigation tool (get_context, get_callers, search_symbol) to read the actual implementation of the symbols those tools surfaced.
Extraction is kind-aware:
- Functions / methods → up to 40 lines.
- Classes / structs / impls → up to 15 lines (header and fields only).
- Interfaces / traits / enums → up to 60 lines.
Leading docblocks are stripped, and symbols are included in request order until the token budget is reached.
Input schema
{
"type": "object",
"properties": {
"symbols": {
"type": "string",
"description": "Newline- or comma-separated list of symbol names (e.g. 'PaymentService.charge\\nMAX_RETRIES'). Partial matches accepted — the closest matching non-file symbol is used for each name."
},
"token_budget": {
"type": "integer",
"description": "Hard token cap across all returned snippets. Default: 2000."
},
"repo": {
"type": "string",
"description": "Restrict to a specific registered repo by name (global / multi-repo mode only)."
}
},
"required": ["symbols"],
"additionalProperties": false
}
Example
Request:
{ "symbols": "PaymentService.charge\nRetryQueue.flush", "token_budget": 1500 }
The response contains the extracted source for each matched symbol, in request order, trimmed to fit the budget.
When to use
- Read implementations cheaply: after
get_contextorget_callersreturns symbol names, fetch their code in one call instead of multiple file reads. - Stay inside a token budget: the budget cap keeps the payload bounded so it is safe to pass straight into LLM context.
Notes
- Available over both stdio and SSE transports.
- Each requested name resolves to the closest matching non-file symbol.