Overview
WarpGrep is a code search agent that uses a multi-turn conversation to explore repositories. The model has its tools (grep_search, read, list_directory, glob, finish) built in — you do not need to pass a tools array in your requests.
Model
Usemorph-warp-grep-v2.1 as the model identifier.
Message Format
WarpGrep uses a structured format in the initial user message with flat absolute paths:Format Components
<repo_structure>: Flat list of absolute paths — repo root first, then all files/directories to depth 2. No indentation, no tree characters, no trailing/on directories.<search_string>: Natural language description of what code to find
Example Request
See Direct API Access for the full protocol details including tool execution and multi-turn flow.
Multi-Turn Conversation
WarpGrep uses built-in tool calling (up to 6 turns). The agent will:- Turn 1: Analyze your search query and call tools (
grep_search,list_directory,glob) to explore - Turns 2-5: Refine search based on results, read specific files
- Final turn: Call
finishwith code locations
{role: "tool", tool_call_id: "...", content: "..."} messages.
Request Parameters
Tools are built into the model — you do not need to pass a
tools parameter. The model will return tool_calls automatically.Response Format
The agent responds with structuredtool_calls:
finish.
On tool-call turns the assistant
content is null. Read only the tool_calls array.Available Tools
WarpGrep uses five tools:grep_search: Search for regex patterns across files. Case-insensitive by default.read: Read file contents with optional line rangeslist_directory: Explore directory structureglob: Find files by name/extension pattern (sorted by mtime)finish: Submit final answer with code locations. Paths are absolute, matching the paths from the repo structure.
SDK Integration
For easier integration, use the WarpGrep SDK components:- TypeScript Tool: Drop-in tool for AI SDKs
- Python Guide: Complete Python implementation
Error Codes
Direct API Guide
Build your own WarpGrep harness
Python Implementation
Complete Python guide with examples