Skip to main content
Glama

find_definitions

Read-onlyIdempotent

Locate where a function, type, or constant is defined and get its file and line, or search symbol names by wildcard pattern. Use it to find definitions before checking usages.

Instructions

Finds where a function, type or constant is defined and returns one line per definition, with its file and line. Use it to locate a symbol, or to search names by pattern: name may hold .* wildcards, so parse_.* lists every matching name. kind narrows the search to functions or to types; without it constants are found too. For the places that use a name use find_usages; for a text that is no name use search_source. A long list stops at 200 items unless all is true. A name the graph does not hold is answered with an error line, with suggestions when similar names exist.

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>"
    },
    "name": "find_definitions"
  }
}

Input Schema

NameRequiredDescriptionDefault
allNoList everything instead of stopping at 200 items.
kindNofunction: functions and methods; type: classes, interfaces, structs, enums; any: all, constants included.any
nameYesName; literal text with optional .* wildcards.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.15.0

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive, and closed-world, yet the description still adds real behavior: a 200-item cap lifted by `all`, and an error line with name suggestions when the symbol is unknown. It does not state result ordering or whether the error line affects exit status, which keeps it short of a 5.

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 purpose, then alternatives, then parameter behavior and limits; each sentence carries distinct information. The prose is dense in places (wildcard, kind, cap, and error behavior packed into one paragraph) but nothing is redundant.

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

Completeness5/5

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

With no output schema, the description compensates by describing the return format explicitly, along with the truncation limit, the unknown-name error path, and wildcard semantics. An agent has everything needed to call this correctly on the first try.

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 100%, so baseline is 3, but the description adds meaning the schema lacks: a concrete wildcard example (`parse_.*` lists every matching name) and the consequence of omitting `kind` (constants are found too). The `all` cap interaction is also spelled out, though the default false is only implied.

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?

States a specific verb and resource ("Finds where a function, type or constant is defined") plus the return shape ("one line per definition, with its file and line"). It also explicitly distinguishes itself from siblings by name, so an agent can pick it over find_usages or search_source without opening a schema.

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

Usage Guidelines5/5

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

Gives explicit alternatives with their selecting conditions: find_usages for places that use a name, search_source for text that is no name. It also explains when to use `kind` versus leaving it off, covering the positive and negative cases within a single tool.

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