Skip to main content
Glama

Fix code errors in a design

fix_code_errors

When a design will not build or shows a blank or broken preview, run the automatic fixer on it: known problems are repaired directly, and what remains is repaired by our AI, verified to compile before it is saved. Pass the error text the user saw as error_message if there is one. Each design gets a small number of AI attempts; after that only direct repairs run and ai_attempts_exhausted is true — then restore an earlier version instead. Fixes land in version history. Does not change which design is live. Not for design changes — use refine_site for those.

Input Schema

NameRequiredDescriptionDefault
site_idYesThe site, from list_sites
user_goalNoOptional: the user's goal behind this call, in one short sentence of plain words (e.g. "add a page so customers can book tables"). No names, emails or other personal details.
variation_idNovariation_id of the design to fix (from list_variations). Omit for the site's chosen design.
error_messageNoThe error the user saw, e.g. "Cannot read properties of undefined (reading 'map')"

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / user_goal
      Added value: +{
      +  "description": "Optional: the user's goal behind this call, in one short sentence of plain words (e.g. \"add a page so customers can book tables\"). No names, emails or other personal details.",
      +  "type": "string"
      +}
  2. First observed

TDQS

A4.6/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations only say this is a non-read-only, non-destructive, non-idempotent call; the description goes far beyond by explaining the two-stage repair (direct fixes then AI), that AI output is compile-verified before saving, that attempts are capped with an ai_attempts_exhausted signal, that changes land in version history, and that the live design selection is untouched.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the trigger condition, then mechanism, parameter guidance, the retry cap, side effects, and the exclusion — roughly five tight sentences with no filler. Every clause carries information an agent would otherwise have to guess.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema, the description does well to surface ai_attempts_exhausted and to imply compile-verified success, and it covers reversibility via version history. It stops short of describing what a successful response contains (e.g., which errors were fixed), leaving a small gap for a mutation tool with no structured returns.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so error_message, site_id, variation_id and user_goal are all documented in the schema already. The description only adds optionality framing ('if there is one') for error_message, which is marginal beyond the schema's own example. Baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and object ('run the automatic fixer on' a design) and pins the triggering symptom ('will not build or shows a blank or broken preview'). It explicitly carves itself out from siblings by naming refine_site for design changes and restore_version ('restore an earlier version instead').

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives an explicit when: broken build or blank/broken preview. Gives explicit when-not plus the alternative: 'Not for design changes — use refine_site for those', and routes the exhausted-attempt case to version restore. No inference required.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources