Skip to main content
Glama

Update a draft form

update_form

Update a form that belongs to the authenticated organization. Requires an org API key or OAuth sign-in with the forms:write scope. Same checks as PATCH /api/v1/forms/{id}: title, settings, and fields. A field entry with an id updates that field. A field entry with no id inserts a field. op add also inserts a field, and that row must not include an id. The server assigns the id. Required on an insert: label and type (an existing field type). Optional on an insert: helpText (at most 2000 characters), required, options, and stageId. stageId defaults to the Interest stage, or the first stage. New fields are appended. order on an insert is ignored. On an existing field, optional order is an integer greater than or equal to 0 and sets that field's position. An order already used by another field on this version is refused (409 'A field already occupies this order on the form version.'). op remove, or removeFieldIds, deletes fields on the current draft. Answers and consents are matched by field key on every version of the form, not by the draft field id. A field that has answers or consents cannot be removed (409 'This field has answers or consents and cannot be removed.'). Changing a field key is refused when that field's current key, or the new key, already has answers or consents on this form (409 'A field key that already has answers or consents cannot be changed.'). At most 20 fields can be added and 20 removed in one call. A form can hold at most 140 fields. Title is at most 200 characters, a field label at most 500, and stored settings JSON at most 32 KB. A field id that is not on the current draft returns 409 'This field id is not on the current draft.' Re-read the form with get_form and retry with the current field ids. A malformed field id is rejected. Top-level settings keys whose names start with __ are ignored, and the stored editor stamp is kept. A lower editorSeq does not overwrite a newer save. A form that belongs to another organization is not found. MCP, an org API key, and OAuth share a limit of 60 updates per organization per hour. Adding or removing fields uses that same limit. A website session is not counted. Returns the updated draft, any new field ids, and editorUrl (/app/forms/{formId}). Does not publish the form.

Input Schema

NameRequiredDescriptionDefault
titleNoForm title, at most 200 characters. On a published form this is held as a draft until publish.
fieldsNoFields to update, add, or remove. An id updates that field. No id inserts a field. op add inserts a field and must not include an id (label and type required; helpText at most 2000 characters, required, options, and stageId optional; stageId defaults to Interest or the first stage; the server assigns the id). On an existing field, order is an integer greater than or equal to 0 and sets that field's position. order on an insert is ignored and the new field is appended. An order already used by another field on this version is refused. op remove deletes that field when it is on the current draft and its key has no answers or consents on any version of this form. At most 20 adds and 20 removes per call. A form holds at most 140 fields. Unknown keys are rejected. Omitted keys are not written.
formIdYesForm id in the authenticated organization.
settingsNodescription, indexable, confirmationMessage, and notifyEmails are type-checked. Other client keys are stored. Top-level keys whose names start with __ are ignored, including editorSession and editorSeq inside settings.
editorSeqNoEditor sequence for this session. A lower sequence does not overwrite a newer save.
editorSessionNoEditor tab session. Send with editorSeq. Omitted saves keep last-commit-wins and leave the stored stamp.
removeFieldIdsNoField ids to delete from the current draft. A field whose key has answers or consents on any version of this form is refused. Combined with op remove, at most 20 deletes per call.

Output Schema

NameRequiredDescriptionDefault
addedNoFields inserted by this call.
titleYes
fieldsYes
formIdYesDraft form id.
statusYes
settingsNoSettings the editor would show. Null when unset.
editorUrlYesEditor URL, /app/forms/{formId}.
versionIdNoVersion being edited, when one exists.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed20 schema fields changed
    • removedInput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
    • addedInput schema / properties / editorSeq / description
      Added value: +"Editor sequence for this session. A lower sequence does not overwrite a newer save."
    • addedInput schema / properties / editorSeq / minimum
      Added value: +1
    • addedInput schema / properties / editorSeq / type
      Added value: +"integer"
    • addedInput schema / properties / editorSession / description
      Added value: +"Editor tab session. Send with editorSeq. Omitted saves keep last-commit-wins and leave the stored stamp."
    • addedInput schema / properties / editorSession / type
      Added value: +"string"
    • addedInput schema / properties / fields / description
      Added value: +"Fields to update, add, or remove. An id updates that field. No id inserts a field. op add inserts a field and must not include an id (label and type required; helpText at most 2000 characters, required, options, and stageId optional; stageId defaults to Interest or the first stage; the server assigns the id). On an existing field, order is an integer greater than or equal to 0 and sets that field's position. order on an insert is ignored and the new field is appended. An order already used by another field on this version is refused. op remove deletes that field when it is on the current draft and its key has no answers or consents on any version of this form. At most 20 adds and 20 removes per call. A form holds at most 140 fields. Unknown keys are rejected. Omitted keys are not written."
    • addedInput schema / properties / fields / items
      Added value: +{
      +  "additionalProperties": true,
      +  "properties": {
      +    "order": {
      +      "description": "Position of an existing field (an entry with id). Integer greater than or equal to 0. An order already used by another field on this version is refused. Ignored on an insert; new fields are appended. Omitted keys are not written.",
      +      "minimum": 0,
      +      "type": "integer"
      +    }
      +  },
      +  "type": "object"
      +}
    • addedInput schema / properties / fields / type
      Added value: +"array"
    • addedInput schema / properties / formId / description
      Added value: +"Form id in the authenticated organization."
    • removedInput schema / properties / formId / minLength
      Removed value: -1
    • addedInput schema / properties / removeFieldIds / description
      Added value: +"Field ids to delete from the current draft. A field whose key has answers or consents on any version of this form is refused. Combined with op remove, at most 20 deletes per call."
    • addedInput schema / properties / removeFieldIds / items
      Added value: +{
      +  "type": "string"
      +}
    • addedInput schema / properties / removeFieldIds / type
      Added value: +"array"
    • addedInput schema / properties / settings / additionalProperties
      Added value: +true
    • addedInput schema / properties / settings / description
      Added value: +"description, indexable, confirmationMessage, and notifyEmails are type-checked. Other client keys are stored. Top-level keys whose names start with __ are ignored, including editorSession and editorSeq inside settings."
    • addedInput schema / properties / settings / type
      Added value: +"object"
    • addedInput schema / properties / title / description
      Added value: +"Form title, at most 200 characters. On a published form this is held as a draft until publish."
    • addedInput schema / properties / title / maxLength
      Added value: +200
    • addedInput schema / properties / title / type
      Added value: +"string"
  2. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": false,
      +  "properties": {
      +    "added": {
      +      "description": "Fields inserted by this call.",
      +      "items": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "id": {
      +            "$ref": "#/properties/fields/items/properties/id"
      +          },
      +          "key": {
      +            "$ref": "#/properties/fields/items/properties/key"
      +          },
      +          "label": {
      +            "$ref": "#/properties/fields/items/properties/label"
      +          },
      +          "order": {
      +            "$ref": "#/properties/fields/items/properties/order"
      +          },
      +          "required": {
      +            "$ref": "#/properties/fields/items/properties/required"
      +          },
      +          "stageId": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "type": {
      +            "$ref": "#/properties/fields/items/properties/type"
      +          }
      +        },
      +        "required": [
      +          "id",
      +          "key",
      +          "label",
      +          "type",
      +          "required",
      +          "order"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "editorUrl": {
      +      "description": "Editor URL, /app/forms/{formId}.",
      +      "format": "uri",
      +      "type": "string"
      +    },
      +    "fields": {
      +      "items": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "id": {
      +            "type": "string"
      +          },
      +          "key": {
      +            "type": "string"
      +          },
      +          "label": {
      +            "type": "string"
      +          },
      +          "order": {
      +            "type": "integer"
      +          },
      +          "required": {
      +            "type": "boolean"
      +          },
      +          "type": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "id",
      +          "key",
      +          "label",
      +          "type",
      +          "required",
      +          "order"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "formId": {
      +      "description": "Draft form id.",
      +      "type": "string"
      +    },
      +    "settings": {
      +      "description": "Settings the editor would show. Null when unset."
      +    },
      +    "status": {
      +      "type": "string"
      +    },
      +    "title": {
      +      "type": "string"
      +    },
      +    "versionId": {
      +      "description": "Version being edited, when one exists.",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "formId",
      +    "title",
      +    "status",
      +    "editorUrl",
      +    "fields"
      +  ],
      +  "type": "object"
      +}
  3. Added

TDQS

A4.6/5.0
Behavior5/5

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

Far beyond the three hint annotations, the description discloses auth/scopes, cross-org isolation ("belongs to another organization is not found"), a 60-updates-per-organization-per-hour shared limit, the full 409 catalogue (occupied order, field with answers/consents, key change refused, stale field id), caps (20 add/20 remove per call, 140 fields/form), __-prefixed settings keys being ignored, and editorSeq last-write-wins semantics. Side effects of the removal path are spelled out, and the draft-only, data-protecting constraints make the delete behavior consistent with destructiveHint=false.

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?

Purpose, auth, and the PATCH-equivalence are front-loaded, and the length is largely justified by the tool's many constraints (limits, id rules, 409 conditions). It loses a point for repeating schema content nearly verbatim (order semantics, op add requirements, removeFieldIds behavior) that the input schema already carries.

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?

For a complex mutation with nested objects, 7 parameters, and an output schema, the description covers everything an agent needs: identity/scope, required scope, insert vs update vs delete semantics, quotas, conflict handling, and recovery guidance. Return values are already handled by the output schema, so no gap remains.

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 description coverage is 100%, so the baseline is 3; the description adds real meaning the schema does not fully convey, such as stageId defaulting to the Interest or first stage, the server assigning new field ids, order being ignored on inserts, and the error semantics for order collisions and unknown field ids. It does, however, restate much of what the nested schema fields already document.

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?

"Update a form that belongs to the authenticated organization" gives a specific verb plus resource and an explicit tenancy scope. It also distinguishes itself from siblings by naming get_form as the re-read path and stating "Does not publish the form," which separates it from publish_form/create_form without opening a schema.

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

Usage Guidelines4/5

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

Usage context is strong: it names the auth requirement (org API key or OAuth with forms:write), tells the agent to re-read with get_form and retry on stale field ids, and clarifies it never publishes. It stops short of explicitly stating when to prefer create_form, discard_form, or publish_form instead, so exclusions are implied rather than enumerated.

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