gemini_summarize
Summarize large files, directories, or codebases to get a quick structured overview and understand unfamiliar code without reading it yourself.
Instructions
Summarize a file or an entire directory/codebase using Gemini's large context window. USE THIS TOOL WHEN: (1) You need a quick overview of a large file (>500 lines) without reading it yourself. (2) You need to understand the structure and purpose of an unfamiliar codebase or directory. (3) You want to summarize lengthy logs, documentation, or data files. For directories, this tool automatically traverses the file tree, skipping node_modules, .git, binary files, and other non-essential content. It respects a ~4MB total content limit to stay within Gemini's context window. Returns a structured summary from Gemini.
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": {
"target_path": "<target_path>"
},
"name": "gemini_summarize"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| focus | No | Optional focus area for the summary. Examples: "architecture", "API endpoints", "error handling patterns", "data flow", "configuration options". If omitted, Gemini provides a general-purpose summary. | |
| model | No | Override the default Gemini model. If omitted, uses the server default. | |
| max_depth | No | Maximum directory traversal depth (default: 5). Only applies to directories. Use a smaller value (1-2) for shallow overviews of large monorepos. | |
| target_path | Yes | Absolute path to a file or directory to summarize. For directories, all text files will be recursively collected (with filtering). |