Skip to main content
Glama

Discard an open draft

discard_form
Destructive

Discard the open draft of 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 POST /api/v1/forms/{id}/discard. An open draft is an unpublished version newer than the published snapshot. This deletes that draft and clears drafted public settings. The published form stays. Returns { ok: true }. A form with no open draft returns 404 { error: "not found", message: "No open draft to discard." }. That includes a form that was never published and a published form with nothing left to discard. If the form changed since this discard was read, it writes nothing and returns 409 'This form changed. Reload and try again.' This does not delete the form. A form that belongs to another organization is not found.

Input Schema

NameRequiredDescriptionDefault
formIdYesForm id in the authenticated organization.

Output Schema

NameRequiredDescriptionDefault
okYesThe open draft was discarded. The published form stays.

Schema Changelog

Changes observed during successful MCP inspections.

  1. 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 in the authenticated organization."
    • removedInput schema / properties / formId / minLength
      Removed value: -1
  2. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": false,
      +  "properties": {
      +    "ok": {
      +      "const": true,
      +      "description": "The open draft was discarded. The published form stays.",
      +      "type": "boolean"
      +    }
      +  },
      +  "required": [
      +    "ok"
      +  ],
      +  "type": "object"
      +}
  3. Added

TDQS

A4.6/5.0
Behavior5/5

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

Goes well beyond the annotations: it names the auth requirement (org API key or OAuth with forms:write), states exactly what is destroyed (the draft and drafted public settings) versus preserved (the published form), and documents return shapes plus 404/409 semantics. The destructiveHint=true annotation is fully consistent with the described behavior.

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 purpose and auth, then layered with semantics and error cases. Mostly dense, though the sentence enumerating what counts as 'no open draft' is somewhat redundant with the preceding definition.

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?

With an output schema present, the description need not detail return values, yet it still supplies the key error contracts, auth scope, and non-destructive-to-the-form clarification. Nothing needed to invoke this correctly is missing.

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 the formId param is already documented, but the description adds real meaning: the id must belong to the authenticated organization, and a form from another organization resolves as not found rather than erroring differently.

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 and resource ('Discard the open draft of a form') and defines the scope ('belongs to the authenticated organization'). It also preempts confusion with a delete-shaped sibling by explicitly saying 'This does not delete the form', and defines what an 'open draft' is.

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 context for when the tool succeeds and when it fails: a form with no open draft returns 404, and a stale read returns 409. It does not explicitly contrast with siblings like publish_form or update_form, so it stops short of full alternative routing.

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