Symbol Context
Get comprehensive 360-degree context for a code symbol
Get a complete view of a code symbol: its definition, categorized references, community membership, and linked documentation.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
repository | string | Yes | - | Repository name (e.g., "owner/repo") |
symbol_name | string | No | - | Symbol name (e.g., "validateBooking", "BookingService.validate") |
symbol_uid | string | No | - | Direct symbol UID from prior tool calls (zero-ambiguity lookup) |
file_path | string | No | - | Relative file path to disambiguate common names |
include_content | boolean | No | false | Include full symbol source code |
include_documents | boolean | No | false | Include linked markdown documentation |
Either symbol_name or symbol_uid must be provided. Use symbol_uid when you already have a symbol ID from a prior tool call for instant, unambiguous lookup.
Usage
Ask your agent:
"Show me the full context for the authenticateUser function"
"What calls BookingService.validate and what does it depend on?"
"Get the symbol context for the function at src/auth/login.ts"
Response Format
The response is a tagged enum with two possible outcomes:
Found
When the symbol is uniquely identified, returns full 360-degree context:
{
"status": "found",
"symbol": {
"uid": "abc123",
"name": "authenticateUser",
"kind": "Function",
"file_path": "src/auth/login.ts",
"start_line": 45,
"start_column": 0,
"end_line": 72,
"signature": "async function authenticateUser(credentials: Credentials): Promise<User>",
"content": "...",
"centrality_score": 0.85
},
"incoming": {
"calls": [
{
"symbol_uid": "def456",
"name": "handleLogin",
"file_path": "src/controllers/auth.ts",
"line": 23,
"column": 4,
"kind": "Function"
}
],
"imports": [],
"extends": [],
"implements": [],
"contains": [],
"uses": []
},
"outgoing": {
"calls": [
{
"symbol_uid": "ghi789",
"name": "validateCredentials",
"file_path": "src/auth/validator.ts",
"line": 12,
"column": 0,
"kind": "Function"
}
],
"imports": [],
"extends": [],
"implements": [],
"contains": [],
"uses": []
},
"community": {
"community_uid": "comm_001",
"label": "Authentication",
"size": 24
},
"documents": [
{
"document_uid": "doc_001",
"title": "Authentication Guide",
"file_path": "docs/auth/README.md"
}
]
}Ambiguous
When multiple symbols match the query, returns candidates for disambiguation:
{
"status": "ambiguous",
"message": "Found 3 symbols matching 'validate'. Use symbol_uid or file_path to disambiguate.",
"candidates": [
{
"uid": "abc123",
"name": "validate",
"kind": "Function",
"file_path": "src/booking/validator.ts",
"line": 15
},
{
"uid": "def456",
"name": "validate",
"kind": "Method",
"file_path": "src/payment/processor.ts",
"line": 42
},
{
"uid": "ghi789",
"name": "validate",
"kind": "Function",
"file_path": "src/auth/input.ts",
"line": 8
}
]
}To resolve ambiguity, re-call the tool with the symbol_uid from the desired candidate.
Response Fields
Symbol Detail
| Field | Type | Description |
|---|---|---|
uid | string | Unique symbol identifier (use for re-lookups) |
name | string | Symbol name |
kind | string | Symbol kind (Function, Class, Method, Interface, etc.) |
file_path | string | Relative path within the repository |
start_line | number | Start line of the symbol definition |
start_column | number | Start column |
end_line | number | End line |
signature | string | Symbol signature (always included when available) |
content | string | Full source code (only when include_content: true) |
centrality_score | number | Importance score from community detection (higher = more central hub) |
Categorized Edges
References are grouped by relationship type. Each edge includes the target symbol's symbol_uid, name, file_path, line, column, and kind.
| Category | Description |
|---|---|
calls | Function/method calls |
imports | Import references |
extends | Class inheritance |
implements | Interface implementation |
contains | Parent-child containment (e.g., class contains method) |
uses | Variable/type usage |
Outgoing edges are deduplicated by target symbol. Empty categories are omitted from the response.
Community Info
| Field | Description |
|---|---|
community_uid | Community identifier |
label | Human-readable community label |
size | Number of symbols in the community |
Lookup Precision
The tool supports three tiers of lookup precision:
| Tier | Parameter | Speed | Ambiguity |
|---|---|---|---|
| 1. UID lookup | symbol_uid | Sub-millisecond | None |
| 2. Name + file | symbol_name + file_path | Fast | Low |
| 3. Name only | symbol_name | Fast | Possible (returns ambiguous if multiple matches) |
Tips
- Start with name lookup, then use
symbol_uidfrom results for follow-up queries - Use
file_pathto disambiguate common names like "validate", "process", "handle" - Check
centrality_scoreto identify key hub symbols in the architecture - Enable
include_documentsto find documentation linked to the symbol - Combine with Cypher queries for custom relationship traversals
Related
- Context Search - Find symbols by natural language
- Rename Symbol - Multi-file coordinated rename
- Cypher Query - Custom graph queries
- Impact Detection - Analyze change impact