This document provides an overview of Lovable's agent tools system, a web-based development platform focused on precise file modifications, Supabase integration, and parallel tool execution patterns. Lovable distinguishes itself through its line-based editing approach (lov-line-replace), comprehensive integration ecosystem (Supabase, Stripe, security scanning, analytics), and emphasis on efficient parallel tool invocation.
For detailed information on other web-based development platforms, see v0 by Vercel Development Platform and Same.dev Cloud IDE System. For browser automation capabilities, see Comet Browser Assistant by Perplexity.
Sources: Lovable/Agent Tools.json1-435
Lovable provides a tool-based agent system organized into three major categories:
lov- prefixed tools): File reading, editing, writing, copying, renaming, deleting, dependency management, and code searchThe system architecture emphasizes parallel tool execution as the primary operational mode, with tools designed to be invoked simultaneously rather than sequentially whenever possible.
Sources: Lovable/Agent Tools.json1-435
Sources: Lovable/Agent Tools.json1-435
Tool Selection Rules:
| Scenario | Tool | Rationale |
|---|---|---|
| Modify existing code | lov-line-replace | Primary method Lovable/Agent Tools.json57 |
| Create new file | lov-write | Intended use case Lovable/Agent Tools.json41 |
| Large unchanged sections | lov-write with "... keep existing code" | Minimizes code writing Lovable/Agent Tools.json42-43 |
| Multiple files to create | lov-write in parallel | Much faster Lovable/Agent Tools.json49-50 |
| Multiple edits to same file | lov-line-replace sequentially | Parallel same-file edits prohibited Lovable/Agent Tools.json65-66 |
Sources: Lovable/Agent Tools.json40-88 Lovable/Agent Tools.json145-159
Original file content (lines 22-42):
Tool invocation:
| Constraint | Enforcement | Source Line |
|---|---|---|
| Content validation | Prefix/suffix must match exactly | Lovable/Agent Tools.json73 |
| Line number immutability | Use original line numbers for multiple edits | Lovable/Agent Tools.json76 |
| Parallel execution | Cannot edit same file in parallel | Lovable/Agent Tools.json65-66 |
| Uniqueness requirement | Context must uniquely identify section | Lovable/Agent Tools.json64 |
Sources: Lovable/Agent Tools.json57-88
The lov-write tool includes a mandatory pattern for minimizing code rewriting:
Key Rules:
// ... keep existing code Lovable/Agent Tools.json42-43"... keep existing code" Lovable/Agent Tools.json43lov-line-replace over lov-write for modifications Lovable/Agent Tools.json41Sources: Lovable/Agent Tools.json40-55
| Tool Category | Input Format | Output Format | Storage Location |
|---|---|---|---|
supabase--docs-search | query (string), max_results (number) | JSON with title, slug, URL, snippet | N/A (API response) |
supabase--docs-get | slug (string, e.g., "auth/row-level-security") | Full markdown, headings, metadata | N/A (API response) |
secrets--add_secret | secret_name (string, e.g., "STRIPE_API_KEY") | Secret prompt to user | Encrypted store → env vars |
imagegen--generate_image | prompt, target_path, width, height, model | Image file | src/assets/ directory |
security--run_security_scan | None | Security analysis report | Backend database |
websearch--web_search | query, numResults, category | Search results with text content | N/A (API response) |
analytics--read_project_analytics | startdate, enddate, granularity | Analytics data | N/A (API response) |
Sources: Lovable/Agent Tools.json230-433
Lovable strongly emphasizes parallel tool invocation for performance:
Parallel Tool Guidelines:
| Operation Type | Parallelization | Notes |
|---|---|---|
| Read multiple files | ✅ Parallel | Strongly encouraged Lovable/Agent Tools.json147-148 |
| Create multiple files | ✅ Parallel | "Much faster" Lovable/Agent Tools.json49-50 |
| Search operations | ✅ Parallel | Independent queries |
| Edit same file | ❌ Sequential | Prohibited Lovable/Agent Tools.json65-66 |
| Edit different files | ✅ Parallel | Safe Lovable/Agent Tools.json65-66 |
| Line-replace same file | ❌ Sequential | Use original line numbers Lovable/Agent Tools.json76 |
Sources: Lovable/Agent Tools.json40-160
| Use Case | Query | Include Pattern | Exclude Pattern |
|---|---|---|---|
| Find useState hooks | "useState\\(" | "src/**" | "**/*.test.tsx" |
| Find useEffect calls | "useEffect\\(" | "src/**" | "src/components/ui/**" |
| Find API endpoints | "app\\.get\\(" | "src/routes/**" | null |
| Find TypeScript interfaces | "interface\\s+\\w+" | "src/**/*.ts" | "src/**/*.d.ts" |
Special Character Escaping: The tool requires \\ to escape regex special characters like (, ), ., *, etc. Lovable/Agent Tools.json16
Sources: Lovable/Agent Tools.json15-38
The document--parse_document tool handles multiple formats:
Sources: Lovable/Agent Tools.json286-297
Image Generation Guidelines:
flux.schnell by default (small images < 1000px); use flux.dev for hero images/fullscreen banners Lovable/Agent Tools.json308-309Image Editing Use Cases:
Sources: Lovable/Agent Tools.json286-350
secrets--add_secret:
secrets--update_secret:
Sources: Lovable/Agent Tools.json230-254
| Tool | Parameters | Returns | Use Case |
|---|---|---|---|
security--run_security_scan | None | Scan initiated | Start comprehensive Supabase backend analysis |
security--get_security_scan_results | force (boolean) | Security vulnerabilities, RLS gaps | Retrieve scan findings (force=true bypasses wait) |
security--get_table_schema | None | Database schema, security prompt | Analyze table structure and security context |
Detected Security Issues:
Sources: Lovable/Agent Tools.json407-433
Tool Schema:
Sources: Lovable/Agent Tools.json161-185
The websearch--web_search tool provides categorized search with advanced filtering:
| Syntax | Purpose | Example |
|---|---|---|
site:domain.com | Filter to specific domain(s) | site:docs.anthropic.com site:github.com API |
"exact phrase" | Search exact phrase | "gpt5" model name OAI |
-word | Exclude term | jaguar speed -car |
| Multiple domains | Search across domains | site:stackoverflow.com site:github.com |
Return Options:
numResults: Number of results (default: 5) Lovable/Agent Tools.json368-370links: Number of links per result Lovable/Agent Tools.json364-366imageLinks: Number of image links per result Lovable/Agent Tools.json360-362Sources: Lovable/Agent Tools.json352-379
supabase--docs-search:
supabase--docs-get:
| Step | Tool | Input | Output |
|---|---|---|---|
| 1. Search | supabase--docs-search | query: "RLS policies" | slug: "auth/row-level-security" |
| 2. Fetch | supabase--docs-get | slug: "auth/row-level-security" | Full RLS implementation guide with code |
| 3. Implement | N/A | Use documentation | Apply RLS policies to database |
Sources: Lovable/Agent Tools.json256-284
File Copy:
user-uploads://) to project repo Lovable/Agent Tools.json128lov-copy with source_file_path and destination_file_path Lovable/Agent Tools.json127-142File Rename:
lov-rename instead of create + delete Lovable/Agent Tools.json201lov-rename with original_file_path and new_file_path Lovable/Agent Tools.json200-215File Delete:
lov-delete with file_path relative to project root Lovable/Agent Tools.json217-228Website Fetching:
lov-fetch-website fetches content in multiple formats (markdown, HTML, screenshot) Lovable/Agent Tools.json109-125tmp://fetched-websites/ Lovable/Agent Tools.json110"markdown,screenshot" Lovable/Agent Tools.json114-116File Download:
lov-download-to-repo downloads files from URLs Lovable/Agent Tools.json90-107src/assets/ and import as ES6 modules Lovable/Agent Tools.json92Sources: Lovable/Agent Tools.json90-228
The analytics--read_project_analytics tool provides production app usage data:
Parameters:
| Parameter | Type | Format | Description |
|---|---|---|---|
startdate | string | RFC3339 or YYYY-MM-DD | Analysis period start |
enddate | string | RFC3339 or YYYY-MM-DD | Analysis period end |
granularity | string | 'hourly' or 'daily' | Data aggregation level |
Use Cases:
Sources: Lovable/Agent Tools.json381-397
The stripe--enable_stripe tool activates Stripe payment processing:
Sources: Lovable/Agent Tools.json399-405
lov-line-replace with explicit line numbers and ellipsis compression for efficient editingSources: Lovable/Agent Tools.json1-435
Refresh this wiki