Earn 14 free days when your bug report or suggestion is accepted — how it works

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

ParameterTypeRequiredDescription
project_typestringNoAuto-detected. Override with “flutter”, “react”, “nextjs”, etc.
include_screenshotsbooleanNoCapture screenshots after build (default: true if UI project)
test_filterstringNoRun 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

ParameterTypeRequiredDescription
run_idstringYesThe run id returned by codeloop_verify
focus_filesarray of stringNoLimit diagnosis to the listed file paths
project_dirstringNoProject 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

ParameterTypeRequiredDescription
run_idstringYesThe run id returned by codeloop_verify
spec_pathstringYesPath to the section spec being gated
acceptance_pathstringYesPath to the acceptance criteria document
project_dirstringNoProject 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

ParameterTypeRequiredDescription
urlstringYesURL to screenshot
viewportsarrayNoViewport sizes (default: mobile, tablet, desktop)
compare_baselinebooleanNoCompare 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

ParameterTypeRequiredDescription
actual_urlstringYesURL of the coded UI
design_referencestringYesPath 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

ParameterTypeRequiredDescription
screen_namestringYesIdentifier for this screen (e.g. “login”, “dashboard”)
app_namestringNoTarget app window name
run_idstringNoAssociate with an existing run
project_dirstringNoProject root directory

codeloop_update_baseline

Promotes screenshots from a given run to become the new visual baselines for future regression detection.

Parameters

ParameterTypeRequiredDescription
run_idstringYesRun containing the screenshots to promote
screensarray of stringNoSubset 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

ParameterTypeRequiredDescription
actionstringYesAction 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_typeenumNodesktop | browser | android_emulator | ios_simulator (auto-detected if omitted)
x, ynumberNoCoordinates for click/scroll/drag/swipe
textstringNoText for type / type_and_submit / fill actions
keystringNoKeystroke name: enter, tab, escape, etc.
keysstringNoHotkey combo: cmd+s, ctrl+enter, etc.
selectorstringNoCSS selector (browser) or automation ID (Windows UI Automation)
urlstringNoURL for navigate_url or deep_link actions
directionenumNoup | down | left | right (scroll/swipe)
fieldsarrayNoFor fill_form: array of { selector, value, type }
stepsarrayNoFor sequence: array of { action, params, delay_ms }
app_namestringNoApp 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

ParameterTypeRequiredDescription
app_namestringYesApp whose window to record
run_idstringNoExisting run to store video under
max_duration_secondsnumberNoAuto-stop timeout (default: 120)
target_typeenumNodesktop | android_emulator | ios_simulator | browser
project_dirstringNoProject 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

ParameterTypeRequiredDescription
recording_idstringYesID 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

ParameterTypeRequiredDescription
app_namestringYesApp whose window to record
run_idstringNoExisting run to associate with
project_dirstringNoProject 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

ParameterTypeRequiredDescription
expected_flowstringYesFull narrative of the interactions performed and expected outcomes
video_pathstringNoDirect path to video file
run_idstringNoResolve video from a run
project_dirstringNoProject root directory

codeloop_section_status

Tracks progress across multiple project sections for autonomous multi-section development.

Parameters

ParameterTypeRequiredDescription
actionstringYes“get”, “update”, or “next”
section_namestringFor updateSection to update
statusstringFor 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

ParameterTypeRequiredDescription
master_spec_pathstringNoPath to master spec (default: docs/specs/_master.md)
sectionsarray of stringNoLimit 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

ParameterTypeRequiredDescription
master_spec_pathstringNoPath to master spec (default: docs/specs/_master.md)
change_summarystringNoSummary 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

ParameterTypeRequiredDescription
platformenumNoflutter | web | mobile | xcode | android | dotnet | auto (default: auto)
project_dirstringNoProject 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

ParameterTypeRequiredDescription
project_dirstringNoProject 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

ParameterTypeRequiredDescription
project_dirstringNoProject root (auto-discovered if omitted)
project_typeenumNoflutter | 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

ParameterTypeRequiredDescription
categorystringYesTool category (e.g. “hosting”, “email”, “analytics”)
stackobjectNoStack context hints
budgetenumNofree | low | medium | enterprise (default: low)
constraintsobjectNoAdditional 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

ParameterTypeRequiredDescription
contextstringYesUser need or intent in natural language
run_idstringNoOptional 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

ParameterTypeRequiredDescription
project_namestringYesProject name for the report
project_descriptionstringNoShort project description
project_dirstringNoProject 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

ParameterTypeRequiredDescription
sectionsarrayNoSpecific sections to check (default: all)
include_visualbooleanNoInclude 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

ParameterTypeRequiredDescription
section_idstringNoFilter to one section
branchstringNoFilter to one git branch
limitnumberNoMaximum runs to return
sincestringNoISO date — return only runs newer than this
rebuild_indexbooleanNoRebuild 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

ParameterTypeRequiredDescription
section_idstringNoLimit attribution to one section
limitnumberNoMaximum 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

ParameterTypeRequiredDescription
layerenumYesmaster_human | planning | section_implement | repair | integration
contextobjectNoVariables 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

ParameterTypeRequiredDescription
project_dirstringNoProject root (auto-discovered if omitted)

Next Steps