Skip to main content
Glama

Publish a form

publish_form
Destructive

Publish a draft form that belongs to the authenticated organization. Requires an org API key or OAuth sign-in with the forms:write scope. Runs the same checks as POST /api/v1/forms/{id}/publish, including field identity and stage validation. A form with no fields is rejected (400 'A form must have at least one field to publish.'). Publish returns 409 'Publish would remove a field that already has answers or consents.' when the draft would drop a field key that already has answers or consents on any version of the form. Returns formId, status published, publicUrl (the public form URL, the same value as publicFormUrl), the embed URL, and the embed snippet. Does not publish a form that belongs to another organization.

Input Schema

NameRequiredDescriptionDefault
formIdYesForm id of a draft in the authenticated organization.

Output Schema

NameRequiredDescriptionDefault
formIdYesPublished form id.
statusYes
versionYes
embedUrlNoIframe URL, /{org}/{form}?embed=1. Omitted when the form has never been published or is soft-deleted.
publicUrlNoSame URL as publicFormUrl. Omitted when the form has never been published or is soft-deleted.
versionIdYes
embedSnippetNoScript tag that embeds the form. Omitted when the form has never been published or is soft-deleted.
publicFormUrlNoCanonical public form URL. Omitted when the form has never been published or is soft-deleted.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • changedOutput schema / properties / embedSnippet / description
      Previous value: -"Script tag that embeds the form."New value: +"Script tag that embeds the form. Omitted when the form has never been published or is soft-deleted."
    • changedOutput schema / properties / embedUrl / description
      Previous value: -"Iframe URL, /{org}/{form}?embed=1."New value: +"Iframe URL, /{org}/{form}?embed=1. Omitted when the form has never been published or is soft-deleted."
    • changedOutput schema / properties / publicFormUrl / description
      Previous value: -"Canonical public form URL."New value: +"Canonical public form URL. Omitted when the form has never been published or is soft-deleted."
    • changedOutput schema / properties / publicUrl / description
      Previous value: -"Same URL as publicFormUrl."New value: +"Same URL as publicFormUrl. Omitted when the form has never been published or is soft-deleted."
  2. Changed3 schema fields changed
    • removedInput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
    • addedInput schema / properties / formId / description
      Added value: +"Form id of a draft in the authenticated organization."
    • removedInput schema / properties / formId / minLength
      Removed value: -1
  3. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": false,
      +  "properties": {
      +    "embedSnippet": {
      +      "description": "Script tag that embeds the form.",
      +      "type": "string"
      +    },
      +    "embedUrl": {
      +      "description": "Iframe URL, /{org}/{form}?embed=1.",
      +      "format": "uri",
      +      "type": "string"
      +    },
      +    "formId": {
      +      "description": "Published form id.",
      +      "type": "string"
      +    },
      +    "publicFormUrl": {
      +      "description": "Canonical public form URL.",
      +      "format": "uri",
      +      "type": "string"
      +    },
      +    "publicUrl": {
      +      "description": "Same URL as publicFormUrl.",
      +      "format": "uri",
      +      "type": "string"
      +    },
      +    "status": {
      +      "const": "published",
      +      "type": "string"
      +    },
      +    "version": {
      +      "type": "integer"
      +    },
      +    "versionId": {
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "formId",
      +    "versionId",
      +    "version",
      +    "status"
      +  ],
      +  "type": "object"
      +}
  4. Added

TDQS

A4.4/5.0
Behavior5/5

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

Goes well beyond the annotations (readOnlyHint=false, destructiveHint=true, openWorldHint=false) by disclosing auth scope requirements, the specific validation checks run, the 400 rejection for a form with no fields, and the 409 conflict when publishing would drop a field key that already has answers or consents. This explains exactly what the destructive hint means in practice.

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 action and auth requirement, then error behavior and return values in a logical order; every sentence carries information. It is on the dense side but not padded with 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?

For a one-parameter mutation with an output schema, the description covers auth, preconditions, failure modes with exact status codes and messages, and cross-organization restrictions. Although the output schema exists, enumerating the returned fields is harmless reinforcement and 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 description coverage is 100% and the single formId parameter is already documented as a draft in the authenticated organization, so the schema does the work. The description restates the same constraint without adding format or syntax detail, making the baseline 3 appropriate.

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 (publish) and resource (draft form) plus the scope constraint that the form must belong to the authenticated organization. The state transition from draft to published is unambiguous and cannot be confused with siblings like update_form, create_form, or discard_form.

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?

Gives clear preconditions: an org API key or OAuth sign-in with the forms:write scope, and a draft owned by the authenticated org. It does not explicitly name alternative tools or say when not to use this one, but the draft-only scoping implies the usage context well.

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