Skip to main content
Glama

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

NameRequiredDescriptionDefault
focusNoOptional focus area for the summary. Examples: "architecture", "API endpoints", "error handling patterns", "data flow", "configuration options". If omitted, Gemini provides a general-purpose summary.
modelNoOverride the default Gemini model. If omitted, uses the server default.
max_depthNoMaximum directory traversal depth (default: 5). Only applies to directories. Use a smaller value (1-2) for shallow overviews of large monorepos.
target_pathYesAbsolute path to a file or directory to summarize. For directories, all text files will be recursively collected (with filtering).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

A3.9/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations at all, the description carries the full burden and does substantial work: it discloses automatic file-tree traversal, the specific exclusions (node_modules, .git, binaries), and a ~4MB total content limit tied to the model context window. What it omits is failure behavior at that limit (silent truncation vs. error) and any auth/API-key or rate-limit expectations for the Gemini backend.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The purpose statement is front-loaded and the numbered trigger list is scannable and each item earns its place. There is minor redundancy in repeating 'Gemini's large context window' / 'Gemini's context window' as both mechanism and limit rationale, which could be tightened.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a four-parameter read tool with no annotations and no output schema, the definition covers purpose, triggers, traversal behavior, and a size ceiling. The one real gap is the return value: 'Returns a structured summary from Gemini' is vague, and since there is no output schema the agent has no idea of the actual shape or length of the response.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so all four parameters including focus, model, max_depth, and target_path are already documented in the schema, making 3 the baseline. The description reiterates directory traversal semantics that the target_path schema field already states, adding no new meaning such as precedence between focus and max_depth or valid model naming.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb and resource: summarize a file or an entire directory/codebase, plus the mechanism (Gemini's large context window). It is immediately distinguishable from gemini_search or gemini_query in spirit, but it never names a sibling tool or explicitly contrasts itself with gemini_analyze, leaving that differentiation to inference.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Three numbered USE THIS TOOL WHEN scenarios give concrete triggers (>500-line files, unfamiliar codebases, lengthy logs/docs), which is stronger than most definitions. However, it offers no when-not-to-use condition and does not name an alternative tool for the cases it doesn't cover, so an agent must guess what to reach for when a summarizing pass is insufficient.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.