Skip to main content
Glama

inspect_ast_symbols

Query a workspace's AST symbol table and bidirectional call graph by symbol name or file/line to locate enclosing functions, methods, classes, and trace their callers and callees.

Instructions

Query the AST symbol table and bidirectional call graph of a workspace by symbol name or (file_path, line_number).

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "inspect_ast_symbols"
  }
}

Input Schema

NameRequiredDescriptionDefault
sourcesNoOptional in-memory {rel_path: source_code} map.
file_pathNoRelative file path for line-based enclosing symbol lookup.
query_nameNoFunction, method, or class name to look up.
line_numberNo1-based line number for enclosing symbol lookup.
workspace_rootNoWorkspace directory path.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full behavioral burden. It discloses the queryable domain and that the call graph is bidirectional (callers and callees), but says nothing about whether the call graph is optional, whether the operation is read-only, how much of a workspace is indexed, or what the response contains — and there is no output schema to compensate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single front-loaded sentence with no filler, and the primary lookup key is stated before the alternative. It is efficient, though its terseness edges toward under-specification for a five-parameter tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a five-parameter tool with a nested object and zero annotation coverage, the definition is too thin: it omits the in-memory sources overlay, the role of workspace_root, and any indication of return shape despite having no output schema. An agent could identify the tool's purpose but would have to guess how to combine parameters and what to expect back.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the individual parameters are already documented, establishing a baseline of 3. The description adds some combination semantics by pairing query_name versus file_path+line_number, but leaves the sources override map and workspace_root entirely unexplained and gives no precedence rules when both modes' parameters are supplied.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Specific verb ("Query") plus two named resources ("AST symbol table" and "bidirectional call graph") scoped to a workspace, with the lookup keys spelled out. The tool is clearly distinguishable from the patch/diff/fault-localization siblings, though no sibling is referenced by name.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The phrase "by symbol name or (file_path, line_number)" implicitly signals two mutually exclusive lookup modes, which is useful. However, there is no explicit when-to-use guidance, no statement about which mode to prefer, and no prerequisites such as whether workspace_root must exist or how sources relates to file_path.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.