Skip to main content
Glama

Apply safe fixes to a Formhaus definition

fix_definition
Read-only

Call this when validate_definition reports issues with safe fixes, such as a misspelled property name, a missing id or key, an empty label, a one-letter typo in a condition field, a duplicate key nothing refers to or a missing submit…

Instructions

Call this when validate_definition reports issues with safe fixes, such as a misspelled property name, a missing id or key, an empty label, a one-letter typo in a condition field, a duplicate key nothing refers to or a missing submit button. Applies every safe fix and returns { definition, applied, valid, issues }: the repaired definition, the fixes applied in order, and the issues left, the same as validate_definition returns for the repaired definition. Safe fixes never change what the form does beyond the repair. Unsafe fixes, such as pointing a condition at a field two edits away, stay in issues[].fixes for you to check and apply by hand. Save the returned definition, then fix the remaining errors.

Input Schema

NameRequiredDescriptionDefault
definitionYesFormhaus form definition as a JSON object or a JSON string. JSON Schema: https://formhaus.dev/schema/form-definition.json. Top level: id, title, submit { label }, and fields (one step) or steps [{ id, title, fields }]. Field: { key, type, label, validation?, options?, show?, showAny? }. Rules go inside "validation": { required, minLength, maxLength, min, max, pattern, matchField }. Condition: { field, eq | neq | in | notIn | contains | notContains | notEmpty | gt | gte | lt | lte } with exactly one operator, on a field of the same or an earlier step. Optional: lang, messages and labels catalogs, and i18n objects that map texts to translation keys.

Output Schema

NameRequiredDescriptionDefault
validYesfalse when at least one issue has severity "error".
issuesYesIssues left after the safe fixes. Errors first, then warnings. Fix them by hand or apply one of their unsafe fixes after checking it.
appliedYesFixes applied, in order. path is where the issue was before the fix.
definitionNoThe definition with every safe fix applied. Missing when the input is not a JSON object.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.13.4
    • changedInput schema / properties / definition / description
      Previous value: -"Formhaus form definition as a JSON object or a JSON string. JSON Schema: https://formhaus.dev/schema/form-definition.json. Top level: id, title, submit { label }, and fields (one step) or steps [{ id, title, fields }]. Field: { key, type, label, validation?, options?, show?, showAny? }. Rules go inside \"validation\": { required, minLength, maxLength, min, max, pattern, matchField }. Condition: { field, eq | neq | in | notIn | notEmpty | gt | gte | lt | lte } with exactly one operator, on a field of the same or an earlier step. Optional: lang, messages and labels catalogs, and i18n objects that map texts to translation keys."New value: +"Formhaus form definition as a JSON object or a JSON string. JSON Schema: https://formhaus.dev/schema/form-definition.json. Top level: id, title, submit { label }, and fields (one step) or steps [{ id, title, fields }]. Field: { key, type, label, validation?, options?, show?, showAny? }. Rules go inside \"validation\": { required, minLength, maxLength, min, max, pattern, matchField }. Condition: { field, eq | neq | in | notIn | contains | notContains | notEmpty | gt | gte | lt | lte } with exactly one operator, on a field of the same or an earlier step. Optional: lang, messages and labels catalogs, and i18n objects that map texts to translation keys."
  2. Addedv0.13.3

TDQS

A4.6/5.0
Behavior5/5

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

Given readOnlyHint=true, the description resolves the ambiguity an agent could otherwise have from the word 'applies': it returns the repaired definition and explicitly tells the caller to save it, so nothing is persisted server-side. It further discloses a safety guarantee (safe fixes never change behavior beyond the repair), the exact return shape, and why some fixes are withheld.

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

Conciseness4/5

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

Front-loaded with the trigger condition, then the fix classes, then the return contract, then the next action — a sensible order. Slightly overpacked as a single paragraph, and 'the same as validate_definition returns for the repaired definition' is a double-clause that could be tightened.

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

Completeness5/5

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

Even though an output schema exists, the description names the returned fields and their meaning (definition, applied in order, valid, remaining issues), explains the issues[].fixes channel, and states the required next step. For a one-parameter tool with full schema coverage, nothing an agent needs to call it correctly is missing.

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% and the single 'definition' parameter already carries a thorough inline description with the schema URL and shape summary. The tool description adds no syntax or format guidance for the parameter beyond the defect examples, so the 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 ('applies every safe fix') and resource (a Formhaus definition), and enumerates the concrete defect classes it repairs (misspelled property, missing id/key, empty label, duplicate key, missing submit button). It is unambiguously distinguished from its closest sibling 'validate_definition', which only reports.

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?

The trigger is explicit: 'Call this when validate_definition reports issues with safe fixes.' It also draws the boundary against the alternative path — unsafe fixes stay in issues[].fixes and must be applied by hand — and closes with the follow-up step ('Save the returned definition, then fix the remaining errors').

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