read_symbol tool
Tool: read_symbol
Return the full source code of a symbol (function, method, or type) by name — the implementation body itself, not just its location. Use this instead of reading a whole file when you need to see how something is implemented.
Arguments Schema
| Parameter | Type | Required | Description |
|---|---|---|---|
| repo_path | string | Required | Absolute path to the workspace root. |
| symbol | string | Required | Symbol name to read (function/method/type). |
| budget | string | Optional | Token budget: small (500), medium (1500), large (3000). Default medium. |
Tool Input JSONRequest
{
"symbol": "NewServer",
"repo_path": "/path/to/repo",
"budget": "medium"
}Tool Response JSONResponse
// internal/mcpserver/server.go:42-60
func NewServer() *Server {
return &Server{
tools: make(map[string]mcp.Tool),
handlers: make(map[string]func(mcp.CallToolRequest) (*mcp.CallToolResult, error)),
}
}Developer Best Practices
- Use this instead of reading a whole file when you need to see how a specific function or type is implemented.
- Pair with find_symbol to first locate the definition, then read the body.