summarize_file
Summarize files or directories using minimal tokens, extracting structure and content to reduce AI processing costs.
Instructions
Summarize a file or directory without reading every byte. Agents get full structural understanding in ~500 tokens instead of 50,000+.
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>"
},
"name": "summarize_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Absolute path to a file or directory. | |
| max_tokens | No | Total output budget in tokens. | |
| mode | No | "content" (summary of text), "structure" (tree only), "both". | both |
| file_extensions | No | Filter by extensions like [".py", ".md"] (directory only). | |
| max_depth | No | Directory traversal depth limit. | |
| model | No | Used for token counting. | gpt-4o |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||