find_usages
Locate every occurrence of a Python identifier with surrounding code context, including reads, assignments, and imports. Get project-wide references across files or a clear note when unavailable.
Instructions
Find every occurrence of an identifier with surrounding source lines.
Covers reads, assignments, parameters, attribute access, imports and
global/nonlocal declarations. Always reports a project-wide references
section: either the cross-file hits, or that there are none, or that jedi
is not installed and cross-file references were therefore not checked. An
empty result and an unchecked one are not the same answer.
Args: path: Path to a .py file. identifier: Name to search for. context: Lines of context to show around each hit (default 1).
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": {
"path": "<path>",
"identifier": "<identifier>"
},
"name": "find_usages"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| context | No | ||
| identifier | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |