find_definition
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
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | 要查找定义的符号名,如 'get_eq_partition'、'MachineModel'、'DEFAULT_TTL' | |
| exclude_dirs | No | 排除目录,不传则使用默认排除列表,传 [] 则不排除任何目录 | |
| project_path | Yes | Python 项目根目录绝对路径 |