Skip to main content

Overview

The context 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

string
Symbol name to look up (e.g., “validateUser”, “AuthService”)If multiple symbols share this name, the tool returns disambiguation candidates.
string
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.
string
File path to disambiguate common namesExample: "src/auth/validator.ts" when multiple validate functions exist
boolean
default:false
Include full source code for the symbol in results
Enabling this increases response size.
string
Repository name or path. Required when multiple repos are indexed.
At least one of name, uid, or file_path must be provided.

Response

object
required
The target symbol’s metadata
object
required
Categorized incoming references (what depends on this symbol)
object
required
Categorized outgoing references (what this symbol depends on)
array
Execution flows this symbol participates in
array
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

If you have a uid from query() results, always use it for instant, unambiguous lookup. This avoids disambiguation overhead.
The categorization (calls, imports, extends, implements) helps you quickly understand different types of relationships without parsing raw data.
The processes array shows which execution flows involve this symbol. This is crucial for understanding the symbol’s role in the system.
Use context() iteratively: start with one symbol, then call context() on its dependencies to trace through the codebase.
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?”
  • query - Find symbols before getting their context
  • impact - Analyze blast radius before changes
  • cypher - Custom relationship queries
  • gitnexus://repo/{name}/process/{name} - Full execution trace for processes
  • gitnexus://repo/{name}/cluster/{name} - View all symbols in a functional area