Skip to main content
Glama

Simulate a path through a form

simulate_path
Read-only

Call this after validate_definition passes, to check branching, routes, skip and conditional fields by stepping through the form like a user; validate_definition checks only the structure. Runs a headless FormEngine.

Instructions

Call this after validate_definition passes, to check branching, routes, skip and conditional fields by stepping through the form like a user; validate_definition checks only the structure. Runs a headless FormEngine. answers are applied as initial values; a group answer is an array of item objects, such as { "participants": [{ "name": "Ada" }] }. Then actions are pressed in order like a user would: next is refused while its disabled conditions match and on next: false steps until an autoAdvance radio, scale or rating is answered, skip only works on steps with a skip action and submits on the last step. Without actions it presses Next until the last step or a blocking error. Custom validators, onStepValidate and lifecycle hooks are not run. When the definition has errors, returns ok: false and the same validation issues as validate_definition. Otherwise returns the active step path (visited, skipped, visible fields, with item fields as paths such as participants.0.email), a trace of each action with errors or a reason when it did not move, validation errors for visited steps only, wouldSubmit (false while submit is disabled) and the submit payload. Pass overlay to run the form in a translated language; overlayIssues lists overlay entries that were ignored or do not match the source.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "definition": "<definition>"
    },
    "name": "simulate_path"
  }
}

Input Schema

NameRequiredDescriptionDefault
actionsNoButtons to press in order, each "next", "back" or "skip". Omit to press Next until the last step or the first blocking error.
answersNoField values keyed by field key, applied as initial values before the actions, such as {"email": "ann@example.com", "plan": "pro"}. select, radio and multiselect take option values, not labels; scale and rating take whole numbers. Omit to start with an empty form.
overlayNoTranslation overlay for one language: the overlay from translation_template with its values translated. Applied before the run, so labels and errors come out in that language. Omit to run in the source language.
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
okYes
pathNo
traceNo
errorsNoErrors by field key, or by item path such as participants.0.email.
multiStepNo
isLastStepNo
validationYes
currentStepNo
wouldSubmitNo
submitValuesNo
overlayIssuesNoOverlay entries that were ignored or do not match the source.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.13.4
    • changedInput schema / properties / answers / description
      Previous value: -"Field values keyed by field key, applied as initial values before the actions, such as {\"email\": \"ann@example.com\", \"plan\": \"pro\"}. select, radio and multiselect take option values, not labels. Omit to start with an empty form."New value: +"Field values keyed by field key, applied as initial values before the actions, such as {\"email\": \"ann@example.com\", \"plan\": \"pro\"}. select, radio and multiselect take option values, not labels; scale and rating take whole numbers. Omit to start with an empty form."
    • 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. Changed6 schema fields changedv0.13.3
    • changedInput schema / properties / actions / description
      Previous value: -"Navigation actions applied in order."New value: +"Buttons to press in order, each \"next\", \"back\" or \"skip\". Omit to press Next until the last step or the first blocking error."
    • changedInput schema / properties / answers / description
      Previous value: -"Field values keyed by field key."New value: +"Field values keyed by field key, applied as initial values before the actions, such as {\"email\": \"ann@example.com\", \"plan\": \"pro\"}. select, radio and multiselect take option values, not labels. Omit to start with an empty form."
    • changedInput schema / properties / overlay / description
      Previous value: -"Translation overlay applied before the run, so errors come out in that language."New value: +"Translation overlay for one language: the overlay from translation_template with its values translated. Applied before the run, so labels and errors come out in that language. Omit to run in the source language."
    • addedOutput schema / properties / errors / description
      Added value: +"Errors by field key, or by item path such as participants.0.email."
    • addedOutput schema / properties / path / items / properties / visibleFields / description
      Added value: +"Visible field keys. Item fields of groups are listed as paths, such as participants.0.email."
    • addedOutput schema / properties / validation / properties / issues / items / properties / fixes
      Added value: +{
      +  "description": "Ready repairs for this issue. Apply one patch to the definition, then validate again.",
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "patch": {
      +        "description": "RFC 6902 JSON Patch operations (add, replace, remove, move) with JSON pointer paths.",
      +        "items": {
      +          "additionalProperties": {},
      +          "propertyNames": {
      +            "type": "string"
      +          },
      +          "type": "object"
      +        },
      +        "type": "array"
      +      },
      +      "safe": {
      +        "description": "true when applying the patch only repairs the issue and changes nothing else. fix_definition applies these.",
      +        "type": "boolean"
      +      },
      +      "title": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "title",
      +      "safe",
      +      "patch"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
  3. First observedv0.13.1

TDQS

A4.8/5.0
Behavior5/5

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

readOnlyHint=true is consistent with a simulation, and the description adds substantial context beyond annotations: it discloses that custom validators, onStepValidate and lifecycle hooks are not run, documents next/back/skip refusal rules, autoAdvance behavior, and error handling when the definition is invalid. This is unusually thorough for a tool whose annotations only signal read-only.

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-loads the purpose and the validate_definition dependency before diving into mechanics; every sentence carries operational detail. It is dense and long, but the length is justified by tool complexity rather than padding.

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?

Despite having an output schema, the description still explains the return shape (visited/skipped paths, action trace, validation errors for visited steps, wouldSubmit, submit payload, overlayIssues), covering the mutation/simulation semantics an agent needs. Nothing material is missing for a headless form-runner.

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

Parameters4/5

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

Schema coverage is 100%, so baseline is 3, but the description contributes meaning beyond the schema: it explains how a group answer maps to an array of item objects with an example, and how action sequencing semantics (refusal, autoAdvance, skip submission) affect the run. It stops short of exhaustively documenting every parameter, which the schema already does well.

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?

Opens with a specific verb and resource ('check branching, routes, skip and conditional fields by stepping through the form like a user') and explicitly distinguishes itself from sibling validate_definition, which 'checks only the structure.' An agent can route between the two without opening either schema.

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?

States the sequencing condition explicitly ('Call this after validate_definition passes') and the division of labor with the alternative tool. It also covers the default path when actions are omitted, so both the with-actions and without-actions modes are addressed.

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