Tool Reference
You don't call these tools yourself. Your AI coding agent does. The User Rule that npx codeloop initsets up tells Cursor / Claude Code to chain them automatically. This page is a lookup — useful when you want to know what the agent just did, or when you're building a custom integration.
CodeLoop provides 29 MCP tools that your AI agent can call. Each tool returns structured JSON results that the agent uses to make decisions.
codeloop_verify
The primary verification tool. Runs build, lint, tests, and optionally captures screenshots — all in a single call.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
project_type | string | No | Auto-detected. Override with “flutter”, “react”, “nextjs”, etc. |
include_screenshots | boolean | No | Capture screenshots after build (default: true if UI project) |
test_filter | string | No | Run only matching tests (e.g., “auth”) |
Example Output
{
"status": "fail",
"build": { "passed": true, "duration_ms": 4200 },
"lint": { "passed": true, "warnings": 3 },
"tests": {
"passed": 12,
"failed": 2,
"skipped": 0,
"failures": [
{ "name": "AuthService.login", "error": "Expected 200, got 401" },
{ "name": "UserProfile.render", "error": "Missing required prop" }
]
},
"screenshots": {
"captured": 3,
"paths": ["screenshots/home.png", "screenshots/login.png", "screenshots/dashboard.png"]
},
"confidence": 0.72
}codeloop_diagnose
Analyzes verification failures and produces categorized repair tasks, prioritized by severity.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
run_id | string | Yes | The run id returned by codeloop_verify |
focus_files | array of string | No | Limit diagnosis to the listed file paths |
project_dir | string | No | Project root (auto-discovered if omitted) |
Example Output
{
"issues": [
{
"category": "bug",
"severity": "high",
"description": "AuthService.login returns 401 for valid credentials",
"file": "src/services/auth.ts",
"line": 42,
"repair_task": "Check password comparison logic in AuthService.login"
},
{
"category": "type_error",
"severity": "medium",
"description": "UserProfile missing required 'email' prop",
"file": "src/components/UserProfile.tsx",
"line": 15,
"repair_task": "Add email prop to UserProfile usage in Dashboard"
}
],
"priority_order": ["AuthService.login", "UserProfile.render"]
}codeloop_gate_check
Performs a confidence-scored quality gate check. Returns pass/fail with a numerical confidence score. Gates enforce build, tests, screenshots, video evidence, and design match — the agent cannot declare done until all gates pass at the 94% threshold.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
run_id | string | Yes | The run id returned by codeloop_verify |
spec_path | string | Yes | Path to the section spec being gated |
acceptance_path | string | Yes | Path to the acceptance criteria document |
project_dir | string | No | Project root (auto-discovered if omitted) |
Example Output
{
"passed": true,
"confidence": 0.94,
"checks": {
"build": "pass",
"lint": "pass",
"tests": "pass",
"no_regressions": "pass",
"screenshot_evidence": "pass",
"video_evidence": "pass",
"design_compare_evidence": "pass"
},
"recommendation": "Section meets quality threshold. Safe to proceed."
}codeloop_visual_review
Captures screenshots across multiple viewports and compares them against baselines for visual regression detection. Returns images as MCP ImageContent blocks so your agent's own vision model analyses them at zero additional cost.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
url | string | Yes | URL to screenshot |
viewports | array | No | Viewport sizes (default: mobile, tablet, desktop) |
compare_baseline | boolean | No | Compare against stored baseline (default: true) |
codeloop_design_compare
Compares the coded UI against a design specification — Figma export, reference image, or design URL. When Figma is configured via .codeloop/figma.json, it fetches frames automatically. A blocker gate (design_compare_evidence) prevents the agent from shipping until all viewports match within the design match threshold.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
actual_url | string | Yes | URL of the coded UI |
design_reference | string | Yes | Path to design image or Figma URL |
codeloop_capture_screenshot
Captures an app window screenshot for visual review. Brings the target app to the front, takes a window-scoped capture, and restores your IDE focus afterwards.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
screen_name | string | Yes | Identifier for this screen (e.g. “login”, “dashboard”) |
app_name | string | No | Target app window name |
run_id | string | No | Associate with an existing run |
project_dir | string | No | Project root directory |
codeloop_update_baseline
Promotes screenshots from a given run to become the new visual baselines for future regression detection.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
run_id | string | Yes | Run containing the screenshots to promote |
screens | array of string | No | Subset of screen names (default: all) |
codeloop_interact
Performs UI interactions on the running app during a recording session. Supports 40+ actions across desktop (macOS, Windows, Linux), browser, Android emulator, and iOS Simulator. Must be used between codeloop_start_recording and codeloop_stop_recording for full interaction coverage.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
action | string | Yes | Action to perform: click, double_click, right_click, hover, type, keystroke, hotkey, scroll, drag_drop, long_press, type_and_submit, fill_form, select_option, toggle, upload_file, navigate_url, swipe, back_button, deep_link, sequence, and more |
target_type | enum | No | desktop | browser | android_emulator | ios_simulator (auto-detected if omitted) |
x, y | number | No | Coordinates for click/scroll/drag/swipe |
text | string | No | Text for type / type_and_submit / fill actions |
key | string | No | Keystroke name: enter, tab, escape, etc. |
keys | string | No | Hotkey combo: cmd+s, ctrl+enter, etc. |
selector | string | No | CSS selector (browser) or automation ID (Windows UI Automation) |
url | string | No | URL for navigate_url or deep_link actions |
direction | enum | No | up | down | left | right (scroll/swipe) |
fields | array | No | For fill_form: array of { selector, value, type } |
steps | array | No | For sequence: array of { action, params, delay_ms } |
app_name | string | No | App to focus (auto-detected from recording if omitted) |
codeloop_start_recording
Starts a background window recording session. Records the target app's window with multi-monitor support, captures app logs alongside video, and handles platform-specific recording (avfoundation on macOS, gdigrab on Windows, x11grab on Linux).
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
app_name | string | Yes | App whose window to record |
run_id | string | No | Existing run to store video under |
max_duration_seconds | number | No | Auto-stop timeout (default: 120) |
target_type | enum | No | desktop | android_emulator | ios_simulator | browser |
project_dir | string | No | Project root directory |
codeloop_stop_recording
Stops a background recording session. Finalizes the video file, saves captured logs, and restores IDE focus. Use codeloop_interaction_replay afterwards to analyze the recorded session.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
recording_id | string | Yes | ID returned by codeloop_start_recording |
codeloop_record_interaction
All-in-one recording tool that combines start recording, interaction, and stop recording into a single call for simpler workflows.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
app_name | string | Yes | App whose window to record |
run_id | string | No | Existing run to associate with |
project_dir | string | No | Project root directory |
codeloop_interaction_replay
Analyzes a recorded video against an expected interaction flow. Extracts key frames as images, includes captured app logs, and returns MCP ImageContent blocks for your agent's vision model to verify the interactions visually.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
expected_flow | string | Yes | Full narrative of the interactions performed and expected outcomes |
video_path | string | No | Direct path to video file |
run_id | string | No | Resolve video from a run |
project_dir | string | No | Project root directory |
codeloop_section_status
Tracks progress across multiple project sections for autonomous multi-section development.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
action | string | Yes | “get”, “update”, or “next” |
section_name | string | For update | Section to update |
status | string | For update | “pending”, “in_progress”, “completed”, “blocked” |
codeloop_integration_check
Cross-section integration verification. Checks for regressions introduced by one section that break another, and reports per-section confidence.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
master_spec_path | string | No | Path to master spec (default: docs/specs/_master.md) |
sections | array of string | No | Limit to specific sections |
codeloop_replan
Detects spec drift and updates section states after changes to the master spec. Recalculates the dependency graph and re-queues affected sections for verification.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
master_spec_path | string | No | Path to master spec (default: docs/specs/_master.md) |
change_summary | string | No | Summary of what changed in the spec |
codeloop_discover_screens
Static scan for routes and screens in your project. Returns discovered routes, navigation triggers, confidence scores, and file paths. Supports Flutter, web, mobile, Xcode, Android, and .NET projects.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
platform | enum | No | flutter | web | mobile | xcode | android | dotnet | auto (default: auto) |
project_dir | string | No | Project root directory |
codeloop_check_workflow
Enforcement checklist before declaring work complete. Verifies that a verification run was performed, screenshots were captured, video recording with interactions was done, gate check passed, dev log was written, and interaction coverage matches discovered screens.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
project_dir | string | No | Project root directory |
codeloop_init_project
Bootstraps a project for CodeLoop. Creates .codeloop/config.json, agent rule files, MCP config, artifacts directory, and gitignore entries. This is the mandatory first call when CodeLoop has not been initialized in a workspace.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
project_dir | string | No | Project root (auto-discovered if omitted) |
project_type | enum | No | flutter | web | mobile | xcode | android | dotnet | node | auto (default: auto) |
codeloop_recommend_tool
Ranks third-party tools and services from CodeLoop's knowledge base for a given category, stack, and budget. Useful for choosing hosting, databases, email services, analytics, and other infrastructure.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
category | string | Yes | Tool category (e.g. “hosting”, “email”, “analytics”) |
stack | object | No | Stack context hints |
budget | enum | No | free | low | medium | enterprise (default: low) |
constraints | object | No | Additional constraints |
codeloop_recommend_action
A smart router that infers category and budget from project context, then returns relevant recommendations. Simpler than codeloop_recommend_tool for quick, context-aware suggestions.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
context | string | Yes | User need or intent in natural language |
run_id | string | No | Optional run for additional context |
codeloop_generate_dev_report
Aggregates all runs, screenshots, videos, logs, and interaction data into a structured report. Outputs a mandatory prompt to write docs/DEVELOPMENT_LOG.md — a comprehensive development log with evidence from every verification pass.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
project_name | string | Yes | Project name for the report |
project_description | string | No | Short project description |
project_dir | string | No | Project root directory |
codeloop_release_readiness
Comprehensive release quality check that evaluates whether the project (or section) is ready for human review. Checks all sections, aggregates confidence, and provides a clear go/no-go recommendation.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
sections | array | No | Specific sections to check (default: all) |
include_visual | boolean | No | Include visual review in readiness check |
Example Output
{
"ready": true,
"overall_confidence": 0.91,
"sections": [
{ "name": "authentication", "confidence": 0.95, "status": "pass" },
{ "name": "dashboard", "confidence": 0.88, "status": "pass" },
{ "name": "settings", "confidence": 0.90, "status": "pass" }
],
"recommendation": "Project meets release criteria. Ready for human UAT."
}codeloop_run_history
Query the run history for the current project — past verifications and their outcomes, with full lineage (commit, branch, section, parent run, prompt template version, config version) and pass/fail counts. Useful for confidence trends and finding the run that introduced a regression.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
section_id | string | No | Filter to one section |
branch | string | No | Filter to one git branch |
limit | number | No | Maximum runs to return |
since | string | No | ISO date — return only runs newer than this |
rebuild_index | boolean | No | Rebuild the lineage index from disk before querying |
codeloop_visual_attribution
Identify which commit, branch, and section introduced each visual diff. Walks the run lineage and per-screen baselines, then attributes every screenshot change to its source. Use when you need to trace a visual regression to the exact commit that caused it.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
section_id | string | No | Limit attribution to one section |
limit | number | No | Maximum number of attributed changes to return |
codeloop_generate_spec
Generate a design specification from Figma design tokens. Reads.codeloop/figma.json, fetches the file via the Figma REST API, extracts colors, typography and spacing tokens, and writesdocs/specs/design_tokens.json plusdocs/ui_rules.md. The output is consumed bycodeloop_design_compare and the design_compare_evidence gate.
Parameters
None — driven entirely by .codeloop/figma.json and the FIGMA_API_TOKEN env var.
codeloop_list_env_presets
List available environment-normalisation presets used by codeloop_verify for reproducible runs: viewports (mobile_se, tablet_portrait, desktop_1920…), network throttling profiles (3g, 4g, wifi, offline), locale and timezone presets, simulator targets (iphone_15, pixel_7…), seed-data fixtures, and API mock/real/record modes.
Parameters
None — returns the full preset catalog.
codeloop_get_prompt
Retrieve a context-aware prompt template for the current stage of multi-section app development. The prompt manager has five layers:master_human (top-level framing for a new user goal),planning (translate master spec into an ordered build plan), section_implement (per-section build prompt with acceptance criteria), repair (constrained fix loop when verify or gate fails), and integration (cross-section verification at checkpoints).
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
layer | enum | Yes | master_human | planning | section_implement | repair | integration |
context | object | No | Variables to substitute into the template |
codeloop_list_prompts
List every prompt layer with id, description, and required variables. Call this before codeloop_get_prompt when you need to know which variables a layer expects.
Parameters
None — returns the full layer catalog.
codeloop_flush_usage
Drain the persisted offline usage queue and POST events to the CodeLoop backend. Use when the MCP server was running in self-hosted or local mode and the user has switched to cloud, or when a prior session had networking issues and queued events to disk (.codeloop/offline_queue.json).
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
project_dir | string | No | Project root (auto-discovered if omitted) |
Next Steps
- Configuration — customize tool behavior
- Quick Start — get set up