gemini_analyze
Analyze a codebase or file with Gemini to map architecture, dependencies, and patterns, or audit for bugs and security issues across many files.
Instructions
Perform deep, structured analysis of a codebase or file using Gemini. USE THIS TOOL WHEN: (1) You need to understand the architecture of a large, unfamiliar project. (2) You want to audit code for bugs or security vulnerabilities across many files. (3) You need to map out dependencies or identify design patterns in a codebase. (4) You have a specific analytical question about a codebase that requires reading many files. This tool is MORE STRUCTURED than gemini_summarize — it uses specialized prompts for each analysis type and produces categorized, actionable findings. Automatically filters out node_modules, .git, binary files, and other non-essential content.
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>",
"analysis_type": "<analysis_type>"
},
"name": "gemini_analyze"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| 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. | |
| target_path | Yes | Absolute path to the file or directory to analyze. | |
| analysis_type | Yes | Type of analysis to perform: "architecture" — module boundaries, data flow, entry points. "dependencies" — external/internal deps, circular deps, risks. "patterns" — design patterns, conventions, coding style. "bugs" — potential bugs, race conditions, resource leaks. "security" — injection, auth, secrets, OWASP Top 10. | |
| specific_question | No | An additional specific question to answer about the code. This is appended to the analysis prompt for focused results. Example: "Is the database connection pool properly managed?" |