Skip to main content
Glama

Roll back agent draft

rollback_agent_draft
Destructive

Restore a previously PUBLISHED revision (from get_agent_draft's history array) as both the new draft AND the live agent - this reaches the provider (ElevenLabs or the volai engine) and phone routing, same as publish_agent_draft. expectedRevision must equal the current draft revision; invalid_draft means targetRevision is no longer stored (history is limited). If the provider fails or times out in a way we cannot confirm, this returns operation_uncertain and the agent stays locked - it is NOT rolled back automatically. After a timeout call get_agent_draft first and check operation; never re-call rollback_agent_draft blindly - use reconcile_agent_draft_operation or REST POST /v1/agents/{id}/draft/operation once a human has confirmed the live state. On success the response may carry a warnings field (structuredContent.warnings, same codes as update_agent), since the restored revision's first line is republished live - and, when the rollback actually changes the agent's live phone number, per numberE164's three-state rule (see save_agent_draft - a revision with no numberE164 key leaves the number untouched and never triggers this), also number_changed_by_publish with from and to (see publish_agent_draft); this never blocks the rollback. Same data as POST /v1/agents/{id}/draft/rollback (response schema in /openapi.json).

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": {
      "id": "<id>",
      "expectedRevision": "<expectedRevision>",
      "targetRevision": "<targetRevision>"
    },
    "name": "rollback_agent_draft"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYesId of the agent whose draft to roll back, from list_agents. Looks like ag_9f3a2b7c4d1e.
targetRevisionYesRevision to restore, from the history array returned by get_agent_draft (past published revisions still retained). invalid_draft when it is no longer stored.
expectedRevisionYesRevision of the draft as returned by get_agent_draft. The rollback is rejected with revision_conflict when it changed since - reload with get_agent_draft.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior3/5

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

Annotations already declare destructiveHint=true, idempotentHint=false and openWorldHint=true, so the safety profile is partly carried structurally; the description nevertheless adds substantial beyond-annotation context: provider/phone-routing side effects, that operation_uncertain leaves the agent locked and NOT auto-rolled-back, and that warnings never block the rollback. Deducted because the warnings/numberE164 discussion is delegated by reference to save_agent_draft and publish_agent_draft, leaving the actual codes and three-state rule unexplained here.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Purpose and the critical safety warning are front-loaded, which is right. But the text then collapses into a single sprawling sentence with stacked parentheticals about warnings, numberE164 and number_changed_by_publish, which costs readability and buries the actionable recovery steps an agent most needs under a timeout.

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 destructive, open-world, non-idempotent mutation with no output schema, this covers the side effects, the partial-failure semantics, the recovery procedure, and the shape of the success response payload enough to act safely. Nothing essential to invoking it 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 baseline is 3; the description still adds meaning by tying expectedRevision to the concurrency guard ('must equal the current draft revision') and targetRevision to the history array with the invalid_draft consequence when history is trimmed. The revision_conflict escape hatch is described in the schema rather than the prose, so it stops short of full coverage.

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?

Opens with a precise verb+resource+scope: restore a previously PUBLISHED revision as both the new draft AND the live agent. It explicitly separates itself from publish_agent_draft (which it mirrors in reach) and from get_agent_draft (its source of targetRevision), so an agent can distinguish it from siblings 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 Guidelines5/5

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

Gives explicit when-to-use (restore a retained published revision), when-not-to (never re-call blindly after a timeout), and named alternatives with the condition that selects them (get_agent_draft to check `operation`, then reconcile_agent_draft_operation or the REST operation endpoint once a human confirms live state). The failure-path routing is unusually specific.

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.