Skip to main content
Glama
Treeweft

treeweft-mcp

Official
by Treeweft

find_definition

Locates where a class or function is defined by name, returning all matching files for disambiguation. Supports optional kind and source filters to narrow results.

Instructions

Find where a symbol is defined. Looks up Class/Function entities by name. Returns all matches across files (let the caller disambiguate). Optional kind filter ('Class' or 'Function') and source_id to scope to one indexed source.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
kindNo
nameYes
source_idNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2026.9.23

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations, the description carries the transparency burden and discloses key behavior: it returns every match across files and leaves disambiguation to the caller, indicating a read-oriented lookup. It doesn't explicitly state side-effect-freeness, but the 'Find/Looks up/Returns' framing makes the read-only intent clear.

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?

Four short sentences front-load purpose, then behavior, then filters; no filler. The only minor redundancy is 'Find where a symbol is defined' vs 'Looks up ... by name', but it doesn't hurt clarity.

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

Completeness4/5

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

Given the 3-param lookup complexity and an available output schema, the description supplies enough invocation context: what is searched, what is returned, and what each parameter does. A statement about no side effects or source_id provenance would be a small addition, but is not essential.

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 description coverage is 0%, so this dimension relies on the description. It defines name (lookup by name), kind (allowed values 'Class' or 'Function'), and source_id (scope to one indexed source), which covers all three parameters' primary semantics, though it doesn't specify name format or case sensitivity.

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 first sentence names the exact operation ('Find where a symbol is defined') and the second narrows the resource to Class/Function entities, which clearly separates this from sibling tools like find_references and find_callers. It also states the return policy (all matches, caller disambiguates), so there's no ambiguity about scope.

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 provides clear context: use when you need definition locations for a named Class/Function, and use optional filters to narrow by kind or source. It does not explicitly name alternatives or when-not conditions, but its purpose is specific enough to route selection.

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