The user wants to explore or understand something about the codebase. Use the OpenTrace knowledge graph to answer their question.
Query
$ARGUMENTS
Instructions
Use the OpenTrace MCP tools to investigate. Follow this approach:
Orient — Call
get_statsto see what's indexed (node types and counts). This tells you what's available in the graph.Search — Use
search_graphto find nodes matching the user's query. UsenodeTypesto filter when appropriate:- Architecture questions → "Service,Repository"
- Code questions → "Class,Function,Module"
- File/directory browsing → "File,Directory"
- Data questions → "Database,DBTable"
- Infrastructure → "Deployment,Cluster,Namespace"
- Unsure → omit
nodeTypesto search everything
Inspect — Use
get_nodeon the best matches to see full details and neighbors.Trace — Use
traverse_graphto follow relationships:- "What calls X?" →
direction: incoming - "What does X depend on?" →
direction: outgoing - "What's in X?" →
direction: outgoing(CONTAINS relationships) - "How are X and Y connected?" → traverse from both and find common nodes
- "What calls X?" →
List — Use
list_nodeswhen the user wants to see all items of a type (e.g. all services, all files in a directory).Read source — If nodes have a
pathproperty and the user needs code details, useReadto show the source.
Response Guidelines
- Lead with a clear, concise answer before showing supporting details
- Show relationships as paths:
ServiceA --CALLS--> ServiceB --READS--> DatabaseC - Group related information (structure, dependencies, consumers)
- Offer to drill deeper if the graph reveals more to explore
- If the graph doesn't have the data, say so and fall back to
Glob/Grep/Read
Source: opentrace/opentrace — distributed by TomeVault.