Skip to main content
Glama

Simulate a path through a form

simulate_path
Read-only

Run a headless Formhaus form to test branching, routes, skips, and conditional fields by stepping through it like a user. Returns the active path, action trace, validation errors, and submit payload.

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 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.

Input Schema

TableJSON 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. 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 | 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

TableJSON 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. 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"
      +}
  2. First observedv0.13.1

TDQS

A4.8/5.0
Behavior5/5

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

Annotations declare readOnlyHint=true, and the description adds rich behavioral detail beyond that: it runs a headless FormEngine, discloses that custom validators and lifecycle hooks are not run, explains action semantics such as when next is refused or skip is allowed, and describes error returns and overlay handling.

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?

The description is front-loaded with the most important routing guidance and every major sentence carries useful information. It is somewhat long because it details return values that are already likely covered by the output schema, which is a minor redundancy rather than filler.

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?

Given the tool's complexity, the description is exceptionally complete: it covers prerequisites, simulation behavior, explicit exclusions, error cases, overlay support, and return shape. An agent has everything needed to invoke it correctly and interpret the result.

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?

With 100% schema description coverage, the schema already documents all four parameters, so the baseline is 3. The description adds meaningful semantics beyond the schema, notably the group answer format as an array of item objects (e.g. { "participants": [{ "name": "Ada" }] }) and the nuanced behavior of actions during simulation.

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?

The description states a specific verb and resource ('simulate a path through a form') and explicitly contrasts its purpose with validate_definition ('validate_definition checks only the structure'). An agent can distinguish this tool from all siblings without opening any 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?

It gives a clear precondition ('Call this after validate_definition passes'), a positive use case (checking branching, routes, skip and conditional fields), and names the alternative it is not. It also explains the fallback behavior when no actions are supplied.

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