Skip to main content
Glama

Rewrite the script

rewrite_script
Destructive

Rewrites the WHOLE piece under the brief with the format's writer (the same revision pass the writing pipeline runs), then re-dresses only the scenes whose narration changed (visuals are kept). It covers a brief that spans the piece («more rhythm in the second act, and let the ending return to the thesis»); a single scene has its own re-authoring op. Asynchronous: returns a run id, and the project status reports the job by run_id — once completed, with the new version id (job.result.editorialVersionId, also in latestRunByKind.editorial_rewrite). as_branch=false (default) makes the result THE CUT the line renders, as committing a draft does. Writers that require spend confirmation need confirm_spend=true. Requires write. Spends LLM budget: a full script pass, priced like the writing profile of the piece (writingProfiles[].measure in the catalogue of formats).

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": {
      "project_id": "<project_id>",
      "brief": "<brief>"
    },
    "name": "rewrite_script"
  }
}

Input Schema

NameRequiredDescriptionDefault
briefYesWhat to change, in any language (max 4000 chars).
as_branchNoKeep the rewrite as a branch instead of making it the cut. Default false.
project_idYes
version_idNoOptional: the base version; default the project's head.
confirm_spendNoRequired when the piece's writer requires spend confirmation (`requiresSpendConfirmation` in the catalogue of formats).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / confirm_spend / description
      Previous value: -"Required when the piece's pen requires spend confirmation (see `list_referents.requiresSpendConfirmation`)."New value: +"Required when the piece's writer requires spend confirmation (`requiresSpendConfirmation` in the catalogue of formats)."
  2. First observed

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: asynchronous run-id lifecycle, the exact status path and result field, the fact that as_branch=false makes the result THE CUT (which explains the destructiveHint), that visuals are re-dressed only for scenes whose narration changed, and that it consumes LLM budget priced like the writing profile.

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 core action and scope, then layers in consequences; nearly every clause carries information. Some density (parenthetical field paths, curly-quoted example brief) makes it heavier than needed for a single paragraph.

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?

There is no output schema, yet the description fully explains how to retrieve the result (run_id via project status, job.result.editorialVersionId) and what state a completed run produces. For a destructive, budget-spending async mutation, nothing an agent needs to call it safely 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 80%, so most parameters are already documented; the description adds real meaning on top by explaining what as_branch actually does ('makes the result THE CUT the line renders, as committing a draft does') and by tying confirm_spend to the writer's requiresSpendConfirmation flag. brief and version_id add little beyond the schema.

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 with explicit scope: 'Rewrites the WHOLE piece under the brief with the format's writer,' and immediately contrasts it with scene-level re-authoring. An agent can distinguish this from a per-scene op without opening either 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?

Gives a clear selection rule — use this when the brief spans the piece, use the scene-level op for a single scene — plus actionable conditions for confirm_spend and the write scope requirement. It does not explicitly say when to prefer generate_script over a rewrite, which is the one remaining routing ambiguity.

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