Skip to main content
Glama
0xYubo
by 0xYubo

find_definition

Read-only

Locate symbol definitions in Python projects: functions, classes, and assignments. Returns file-aggregated hits with line numbers, signatures, and enclosing context.

Instructions

找出符号在项目中的定义处:函数定义、类定义、模块级/类级赋值(常量、类属性)。与 trace_callers 配对使用——先找定义看签名,再追调用链。返回按文件聚合的 JSON:{total_found, returned, truncated, files:[{file:相对路径, hits:[{line, kind, name, signature, parent}]}]},kind 为 function/class/assignment,parent 为所在类或函数(顶层为 )。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes要查找定义的符号名,如 'get_eq_partition'、'MachineModel'、'DEFAULT_TTL'
exclude_dirsNo排除目录,不传则使用默认排除列表,传 [] 则不排除任何目录
project_pathYesPython 项目根目录绝对路径
Behavior4/5

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

With readOnlyHint=true, the description adds valuable behavioral context beyond the annotation: it describes the aggregated JSON return format, the 'truncated' flag indicating possible result truncation, and the meaning of 'kind' and 'parent'. This goes beyond a simple read-only hint and informs the agent about the exact output structure.

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?

The description is compact and front-loaded with the purpose, then pair-usage, then return format. It is a bit dense due to the inlined JSON schema, but every sentence earns its place—no filler or repetition. The structure is logical, though slightly heavier than ideal.

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 no output schema, the description fully documents the return format including nested objects, fields, and semantics for 'kind' and 'parent'. It also covers the truncation behavior and file aggregation. For a read-only tool with a clear return contract, this is quite complete, though it doesn't explicitly address not-found cases or pagination parameters.

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 coverage is 100%, so the schema already documents all three parameters (project_path, name, exclude_dirs). The description does not add parameter-specific semantics beyond what the schema provides, but it does reinforce the meaning of 'name' indirectly via the return format. Baseline of 3 is appropriate.

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 clearly identifies the verb+resource: '找出符号在项目中的定义处' (find where a symbol is defined), and enumerates the kinds of definitions (function, class, module/class-level assignments). It distinguishes itself from siblings by explicitly pairing with trace_callers and outlining a workflow, making it unambiguous what this tool does and how it relates to others.

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?

The description states the primary use case (find definition to see signature) and explicitly recommends pairing with trace_callers ('与 trace_callers 配对使用——先找定义看签名,再追调用链'). It provides clear context on when to use the tool, though it does not explicitly state exclusions or 'when not to use' scenarios.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/0xYubo/Ripple-Mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server