[analysis]
Gets source code for a method (bounded by max lines).
Agents need enough source and member detail to act, but whole files are often too much context.
These tools provide bounded, structured slices of types and methods so the model can inspect intent without flooding the prompt.
Try it locally in the Glider playground
| Name | Type | Required | Description |
|---|---|---|---|
| methodName | string | No | Method name. Provide this or symbolKey. |
| symbolKey | string | No | A symbolKey from search_symbols/resolve_symbol (preferred; precise for overloads). Provide this or methodName. |
| containingTypeName | string | No | Optional containing type name filter. |
| projectName | string | No | Optional project name filter. |
| maxLines | number | No | Max lines to return. Use 0 for unlimited. Default is 120. |
| bodyOnly | boolean | No | If true, return only the method body (no signature). Default is false. |
| pathStyle | string | No | Path style: 'absolute' (default) or 'relative' (to solution root). |
Get method source
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "get_method_source",
"arguments": {
"methodName": "LoadSolutionAsync",
"containingTypeName": "SolutionManager"
}
}
}{
"success": true,
"data": {
"methodName": "LoadSolutionAsync",
"containingType": "SolutionManager",
"filePath": "/path/to/SolutionManager.cs",
"startLine": 50,
"endLine": 80,
"lineCount": 31,
"truncated": false,
"source": "..."
},
"error": null
}Returns method source (possibly truncated)