Overview
Thecontext tool provides comprehensive information about a specific code symbol, including all incoming and outgoing relationships, process participation, and categorized references. It’s the go-to tool for understanding “what does this symbol do and how is it connected to the rest of the codebase?”
When to use: After
query() to understand a specific symbol in depth. When you need to know all callers, callees, and what execution flows a symbol participates in.Next step: Use impact() if planning changes, or READ gitnexus://repo/{name}/process/{processName} for full execution trace.Parameters
Symbol name to look up (e.g., “validateUser”, “AuthService”)If multiple symbols share this name, the tool returns disambiguation candidates.
Direct symbol UID from prior tool results for zero-ambiguity lookupWhen you have a
uid from query() results, prefer this over name to avoid disambiguation.File path to disambiguate common namesExample:
"src/auth/validator.ts" when multiple validate functions existInclude full source code for the symbol in results
Repository name or path. Required when multiple repos are indexed.
At least one of
name, uid, or file_path must be provided.Response
The target symbol’s metadata
Categorized incoming references (what depends on this symbol)
Categorized outgoing references (what this symbol depends on)
Execution flows this symbol participates in
When multiple symbols match, returns candidates to choose from
Example Usage
Lookup by Name
Lookup by UID (Zero-Ambiguity)
Disambiguate by File Path
With Source Code
Multi-Repo Context
Example Response
Disambiguation Example
When multiple symbols share the same name:Real-World Examples
Example 1: Understanding a Function
Example 2: Debugging an Error
Example 3: Impact Analysis Prep
Best Practices
Use uid when available
Use uid when available
If you have a
uid from query() results, always use it for instant, unambiguous lookup. This avoids disambiguation overhead.Review categorized references
Review categorized references
The categorization (calls, imports, extends, implements) helps you quickly understand different types of relationships without parsing raw data.
Check process participation
Check process participation
The
processes array shows which execution flows involve this symbol. This is crucial for understanding the symbol’s role in the system.Follow the chain
Follow the chain
Use
context() iteratively: start with one symbol, then call context() on its dependencies to trace through the codebase.Disambiguate proactively
Disambiguate proactively
For common names like “validate” or “process”, provide
file_path upfront to avoid disambiguation rounds.Use Cases
- Understanding symbols: “What does this function do?”
- Finding dependencies: “What does this call?”
- Finding dependents: “What calls this?”
- Debugging: “Trace this error’s call chain”
- Refactoring prep: “What breaks if I change this?”
- Process tracing: “Which flows use this?”
Related Tools
- query - Find symbols before getting their context
- impact - Analyze blast radius before changes
- cypher - Custom relationship queries
Related Resources
gitnexus://repo/{name}/process/{name}- Full execution trace for processesgitnexus://repo/{name}/cluster/{name}- View all symbols in a functional area