read_imports
Return import statements from a source file without reading the rest; use it to check dependencies before adding or removing imports.
Instructions
Return the import statements of a source file (imports, includes, Ruby requires), without reading the rest. Read-only.
Use this when: checking a file's dependencies, as before add_import. Don't use this when: changing imports (add_import, remove_import).
Example: file_path="/abs/path/to/module.py"
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": {
"file_path": "<file_path>"
},
"name": "read_imports"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | Absolute path to the source or config file. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |