Tool Use Overview
Saarthi implements a sophisticated tool system that allows AI models to interact with your development environment in a controlled and secure manner. This document explains how tools work, when they're called, and how they're managed.
Core Concepts
Tool Groups
Tools are organized into logical groups based on their functionality:
Category | Purpose | Tools | Common Use |
---|---|---|---|
Read Group | File system reading and exploration | read_file, list_files, list_code_definition_names | Code exploration and analysis |
Search Group | Pattern and semantic searching | search_files, codebase_search | Finding code patterns and functionality |
Edit Group | File system modifications | apply_diff, insert_content, search_and_replace, write_to_file | Code changes and file manipulation |
Browser Group | Web automation | browser_action | Web testing and interaction |
Command Group | System command execution | execute_command | Running scripts, building projects |
MCP Group | External tool integration | use_mcp_tool, access_mcp_resource | Specialized functionality through external servers |
Workflow Group | Mode and task management | switch_mode, new_task, ask_followup_question, attempt_completion | Context switching and task organization |
Always Available Tools
Certain tools are accessible regardless of the current mode:
- ask_followup_question: Gather additional information from users
- attempt_completion: Signal task completion
- switch_mode: Change operational modes
- new_task: Create subtasks
Available Tools
Read Tools
These tools help Saarthi understand your code and project:
- read_file - Examines the contents of files
- list_files - Maps your project's file structure
- list_code_definition_names - Creates a structural map of your code
Search Tools
These tools help Saarthi find patterns and functionality across your codebase:
- search_files - Finds patterns across multiple files using regex
- codebase_search - Performs semantic searches across your indexed codebase
Edit Tools
These tools help Saarthi make changes to your code:
- apply_diff - Makes precise, surgical changes to your code
- insert_content - Adds new lines of content without modifying existing lines
- search_and_replace - Finds and replaces text or regex patterns within a file
- write_to_file - Creates new files or completely rewrites existing ones
Browser Tools
These tools help Saarthi interact with web applications:
- browser_action - Automates browser interactions
Command Tools
These tools help Saarthi execute commands:
- execute_command - Runs system commands and programs