Skip to main content
Glama

Open a draft of a Function

open_draft

Opens a draft of a Function, a private copy of its files to change. Nothing in a draft is live, and it never shows in the Function's Versions or its source. It starts from the live Version, or from a Version named by number, and 'read_function_file' reads its files by its 'draft_id'. A draft belongs to whoever opens it and stays until it is discarded. Each owner has a cap of open drafts per Function. Where 'live_from_cli' is true the live Version came from the CLI, and the next CLI deploy replaces whatever the draft changes, and 'warning' says so in a sentence for the person.

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": {
      "function_name": "<function_name>",
      "name": "<name>"
    },
    "name": "open_draft"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYesA short name for what the draft is for, such as 'pricing page'. It is how the draft is found again.
app_slugNoThe App's slug. Omitted, the Tenant's default App.
function_nameYesThe Function's slug.
version_numberNoThe Version to start from. Omitted, the live one.

Output Schema

NameRequiredDescriptionDefault
draftYes
warningYesWhat the next CLI deploy does to this draft's change. Null where the live Version did not come from the CLI.
app_slugYes
function_nameYes
live_from_cliYesTrue where the live Version was deployed with the CLI, which is most likely from a repository.
live_version_numberYesThe Version that is live. Null where none is.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / properties / warning / description
      Previous value: -"What to tell the person before they rely on this draft. Null where there is nothing to tell."New value: +"What the next CLI deploy does to this draft's change. Null where the live Version did not come from the CLI."
  2. Added

TDQS

A4.4/5.0
Behavior5/5

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

Annotations declare this is a non-read-only, non-destructive, non-idempotent operation, and the description substantially extends that: nothing in a draft is live, it never appears in Versions or source, it belongs to the owner until discarded, each owner has a cap of open drafts per Function, and live_from_cli warns that a CLI deploy will replace draft changes. These are exactly the side-effect and lifecycle details annotations cannot convey.

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?

Information-dense and front-loaded: the definition of a draft comes first, then lifecycle, then the CLI caveat. The final sentence about live_from_cli and 'warning' is slightly convoluted but still earns its place by flagging a real footgun.

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 needn't explain return values, yet it still surfaces the salient outputs (draft_id, live_from_cli, warning). For a state-creating tool with lifecycle and ownership constraints, nothing an agent needs to invoke 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%, so the baseline is 3 — the schema already documents all four parameters including defaults and maxLength. The description reinforces version_number's default ('It starts from the live Version, or from a Version named by number') but adds no syntax or format detail beyond what the schema provides.

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 (opens) and resource (a draft of a Function) and immediately defines what a draft is — a private copy of files to change. It distinguishes the concept from the Function's live Version and its source, so an agent can tell it apart from siblings like list_drafts, get_draft_changes, edit_draft, and discard_draft.

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?

Explains the context of use clearly: it starts from the live Version or a named Version, and 'read_function_file' reads its files by 'draft_id', which routes the agent to the correct follow-up tool. It does not explicitly state when to choose open_draft over edit_draft or preview_draft, so it stops short of full alternative-naming guidance.

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.