Reference for Gemini's built-in tools and their capabilities.
These tools are available only through Gemini CLI:
Performs web search using Google Search API.
Capabilities:
- Real-time internet search
- Current information (news, releases, docs)
- Grounded responses with sources
Usage:
gemini "What are the latest React 19 features? Use Google Search." -o textBest For:
- Current events and news
- Latest library versions
- Recent documentation updates
- Community opinions and benchmarks
Example Queries:
- "What are the security vulnerabilities in lodash 4.x? Use Google Search."
- "What's new in TypeScript 5.4? Use Google Search."
- "Best practices for Next.js 14 app router in November 2025."
Specialized tool for deep codebase analysis.
Capabilities:
- Architectural mapping
- Dependency analysis
- Cross-file relationship detection
- System-wide pattern identification
Usage:
gemini "Use the codebase_investigator tool to analyze this project" -o textOutput Includes:
- Overall architecture description
- Key file purposes
- Component relationships
- Dependency chains
- Potential issues/inconsistencies
Best For:
- Onboarding to new codebases
- Understanding legacy systems
- Finding hidden dependencies
- Architecture documentation
Example:
gemini "Use codebase_investigator to map the authentication flow in this project" -o textSaves information to persistent long-term memory.
Capabilities:
- Cross-session persistence
- Key-value storage
- Recall in future sessions
Usage:
gemini "Remember that this project uses Zustand for state management. Save this to memory." -o textBest For:
- Project conventions
- User preferences
- Recurring context
- Custom instructions
These tools are similar to Claude Code's capabilities:
Lists files and subdirectories in a path.
Parameters:
path: Directory to listignore: Glob patterns to exclude
Example Output:
src/
components/
utils/
index.js
package.json
README.md
Reads file content with truncation for large files.
Supported Formats:
- Text files (all types)
- Images (PNG, JPG, GIF, WEBP, SVG, BMP)
- PDF documents
Parameters:
path: File pathoffset: Starting line (for large files)limit: Number of lines
Large File Handling: If file exceeds limit, output indicates truncation and provides instructions for reading more with offset/limit.
Fast content search powered by ripgrep.
Advantages over grep:
- Optimized performance
- Automatic output limiting (max 20k matches)
- Better pattern matching
Parameters:
pattern: Regex patternpath: Search root- Various ripgrep flags
Pattern-based file finding.
Returns:
- Absolute paths
- Sorted by modification time (newest first)
Example Patterns:
src/**/*.ts- All TypeScript files in src**/*.test.js- All test files**/README.md- All READMEs
Fetches content from URLs.
Capabilities:
- HTTP/HTTPS URLs
- Local addresses (localhost)
- Up to 20 URLs per request
Usage:
gemini "Fetch and summarize https://example.com/docs" -o textInternal task tracking.
Capabilities:
- Track subtasks for complex requests
- Organize multi-step work
- Prevent missed steps
Automatic Usage: Gemini uses this internally for complex tasks.
Gemini automatically selects appropriate tools based on the prompt:
| Prompt Type | Tool Selected |
|---|---|
| "What files are in src/" | list_directory |
| "Find all TODO comments" | search_file_content |
| "Read package.json" | read_file |
| "Find all React components" | glob |
| "What's new in Vue 4?" | google_web_search |
| "Analyze this codebase" | codebase_investigator |
You can explicitly request tools:
gemini "Use the codebase_investigator tool to..." -o text
gemini "Search the web for..." -o text
gemini "Use glob to find all..." -o textWhen using -o json, tool usage is reported:
{
"stats": {
"tools": {
"totalCalls": 3,
"totalSuccess": 3,
"totalFail": 0,
"totalDurationMs": 5000,
"totalDecisions": {
"accept": 0,
"reject": 0,
"modify": 0,
"auto_accept": 3
},
"byName": {
"google_web_search": {
"count": 1,
"success": 1,
"fail": 0,
"durationMs": 3000,
"decisions": {
"auto_accept": 1
}
},
"read_file": {
"count": 2,
"success": 2,
"fail": 0,
"durationMs": 2000,
"decisions": {
"auto_accept": 2
}
}
}
}
}
}| Capability | Claude Code | Gemini CLI |
|---|---|---|
| File listing | LS, Glob | list_directory, glob |
| File reading | Read | read_file |
| File writing | Write, Edit | write_file (in YOLO) |
| Code search | Grep | search_file_content |
| Web fetch | WebFetch | web_fetch |
| Web search | WebSearch | google_web_search |
| Architecture | Task (Explore) | codebase_investigator |
| Memory | N/A | save_memory |
| Task tracking | TodoWrite | write_todos |
Bold = Gemini's unique advantage
In settings or command line, restrict available tools:
gemini --allowed-tools "read_file,glob" "Find config files" -o text{
"security": {
"allowedTools": ["read_file", "list_directory", "glob"]
}
}google_web_search:
- Need current/recent information
- Checking latest versions
- Finding documentation updates
- Community solutions to problems
codebase_investigator:
- New to a codebase
- Understanding complex systems
- Finding hidden dependencies
- Creating documentation
save_memory:
- Recurring project context
- User preferences
- Custom conventions
Research → Implement:
gemini "Use Google Search to find best practices for [topic], then implement them" --yolo -o textAnalyze → Report:
gemini "Use codebase_investigator to analyze the project, then write a summary report" --yolo -o textSearch → Read → Modify:
gemini "Find all files using deprecated API, read them, and suggest updates" -o text