name: go-navigator-read description: Use Go Navigator MCP to explore Go code semantically (packages, symbols, definitions/references, context, metrics, deps) and return file/line/snippets; do not modify code.
Go Navigator (READ) — semantic navigation only
Scope rules
- READ-ONLY: never call
renameSymbolorrewriteAst(or any mutating tool). - Prefer semantic tools over raw text search.
Defaults
- Use
"dir": "."unless user specifies another root. - For any
"package"field, use exact import path fromlistPackages. - Test scope defaults:
- Use
"testScope": "exclude"for architecture/implementation reads. - Use
"testScope": "include"when explicitly analyzing tests or caller chains. - Use
"testScope": "only"for test-only inspection.
- Use
Quick decision matrix
- Need quick understanding of one symbol:
getSymbolContext - Need exact declaration/usage sites:
getDefinitions+getReferences - Need callers/callees around one function:
callGraph - Need architecture/package view:
listPackages+getDependencyGraph - Need quality hotspots:
getComplexityReport+getDeadCodeReport - Need targeted source details:
getFunctionSource/getStructInfo/getFileInfo
Tool notes
listPackages: package discovery, usually first call.getProjectSchema: broad structural overview (depth:summary|standard|deep).listSymbols: grouped symbols by package/file.listImports: grouped imports by file.listInterfaces: grouped interfaces by package.getDefinitions: definition sites (supports limit/offset).getReferences: usage sites (supports limit/offset).getSymbolContext: fastest context bundle before deep dive.callGraph: directional function/method call graph (callers,callees,both) withmaxDepthandmaxNodes.getFunctionSource: exact function/method body by name.getStructInfo: struct declaration (+methods optionally).getFileInfo: file metadata/symbols/source with actual fields:options.withSourceoptions.withCommentsoptions.includeFunctionBodiesoptions.functionBodyLimitfilter.symbolKindsfilter.nameContainsfilter.exportedOnly
getImplementations: interface ↔ concrete implementations.getDependencyGraph: package graph, fan-in/out, cycles.getComplexityReport: LoC/nesting/cyclomatic by function.getDeadCodeReport: unused symbols.
Recommended workflows
Orientation
listPackages { "dir": ".", "testScope": "exclude" }getProjectSchema { "dir": ".", "depth": "standard", "testScope": "exclude" }(optional)getDependencyGraph { "dir": ".", "testScope": "exclude" }(optional)
Understand a symbol
getSymbolContext { "dir": ".", "ident": "<Ident>", "kind": "<optional>", "testScope": "include" }getDefinitions { "dir": ".", "ident": "<Ident>", "testScope": "exclude" }getReferences { "dir": ".", "ident": "<Ident>", "testScope": "include" }callGraph { "dir": ".", "ident": "<Ident>", "direction": "both", "maxDepth": 2, "testScope": "include" }getFunctionSource/getStructInfo/getFileInfoas needed
Quality pass
getComplexityReport { "dir": ".", "package": "<pkg>", "testScope": "exclude" }getDeadCodeReport { "dir": ".", "package": "<pkg>", "limit": 20, "testScope": "exclude" }
Large result sets
- Use limit/offset where available.
- Prioritize relevant files first.
Output guidance
- Always include file paths and lines.
- Keep snippets short (1–5 lines) unless user requests full bodies.
- If user asks a quick question, return concise output (no forced heavy template).