Skip to main content
Glama

get_symbol_definition

Look up the exact definition location of a function, class, or symbol by name and directory, returning file path, line number, and signature.

Instructions

Instantly find where a function, class, or symbol is defined (O(1) lookup).

Much faster than semantic search when you know the exact symbol name.

Args:
    name: The exact name of the function/class/variable
    directory: Path to the codebase directory

Returns:
    Definition location(s) with file path, line number, and signature

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "name": "<name>",
      "directory": "<directory>"
    },
    "name": "get_symbol_definition"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYes
directoryYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior3/5

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

With no annotations, the description carries the full burden; it implies a safe read lookup and discloses the return shape (paths, line numbers, signatures). It does not state behavior when the symbol is missing or ambiguous, nor whether the directory must already be indexed — significant for a tool whose siblings include index_directory and sync_index.

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?

Front-loaded with the performance differentiator, then arguments, then returns — easy to scan. The 'Returns' block partly duplicates the existing output schema, and the Args blocks restate schema fields, so a small amount of space is not earning its place.

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

Completeness3/5

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

The output schema covers return values, and both params are described, but the definition omits index-state prerequisites and not-found/multi-definition behavior. For a two-parameter lookup that depends on a codebase index, that leaves a real gap before invocation.

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

Parameters4/5

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

Schema coverage is 0%, so the description must define both parameters, and it does: name is the 'exact name' (ruling out fuzzy or partial matching) and directory is the codebase path. It stops short of specifying whether directory is absolute or workspace-relative.

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

Purpose5/5

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

The description names a specific verb and resource — 'find where a function, class, or symbol is defined' — plus a sharp scoping trait (O(1) lookup). An agent can distinguish this exact-name definition lookup from fuzzy siblings like super_grep or code_research without opening the schema.

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

Usage Guidelines4/5

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

It gives an explicit selection condition: use this 'when you know the exact symbol name', and contrasts it against semantic search. It lacks a negative case (e.g., use find_references for usages vs. definitions), so the routing is clear but not fully enumerated.

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