-
Notifications
You must be signed in to change notification settings - Fork 18.6k
Open
Labels
FeatureRequestIssues asking for a new feature that does not need a proposal.Issues asking for a new feature that does not need a proposal.ToolsThis label describes issues relating to any tools in the x/tools repository.This label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.Issues related to the Go language server, gopls.
Milestone
Description
I would like to propose an MCP tool that retrieves the source code of a call graph rooted at a specific function, up to a specified depth.
Currently, coding agents interacting with Go codebases struggle to gather relevant context efficiently.
- Token Waste: Agents often read full files to inspect single functions.
-
High Latency: Tracing a function call across packages requires multiple tool round-trips (Read File
$\to$ Parse$\to$ Go to Definition$\to$ Read File). - Context Fragmentation: Agents struggle to maintain a mental model of cross-package dependencies when files are read largely in isolation.
These problems can be addressed by a new fetch_call_graph tool. It would work like so:
If TestA calls FuncB, and FuncB calls pkgC.FuncD:
- Request:
{ symbol: "TestA", depth: 2 } - Response: Source code for
TestA,FuncB, andpkgC.FuncD.
This allows agents to instantly retrieve the "semantic neighborhood" of a failing test or a bug, regardless of file or even package boundaries. The result is a high-signal context window populated only with reachable code, significantly improving debugging performance and reducing token consumption.
shoenig
Metadata
Metadata
Assignees
Labels
FeatureRequestIssues asking for a new feature that does not need a proposal.Issues asking for a new feature that does not need a proposal.ToolsThis label describes issues relating to any tools in the x/tools repository.This label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.Issues related to the Go language server, gopls.