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).

Input Schema

TableJSON 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.8/5.0
Behavior5/5

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

Adds substantial context beyond annotations: asynchronous execution with a run id, how to poll completion, the result version id location, that as_branch=false makes the result the actual cut the line renders, permission requirement, and that it spends LLM budget priced by the piece's writing profile. This goes well past the readOnly/destructive/idempotent hints.

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-loads the core action and is dense with useful detail, but the run-id/result-path sentence and nested parentheticals make it heavier than necessary. Every sentence does carry information, so it is dense rather than padded.

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?

No output schema exists, yet the description explains the return contract (run id, job.result.editorialVersionId, latestRunByKind.editorial_rewrite) plus side effects and cost. Nothing an agent needs to invoke and track this job 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 already 80%, but the description still adds meaning: as_branch=false is framed as "THE CUT the line renders, as committing a draft does," and confirm_spend is tied to the requiresSpendConfirmation flag in the format catalogue. brief/version_id semantics remain largely in-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+resource (rewrites the whole piece under a brief) and immediately scopes it against the sibling that handles a single scene ("a single scene has its own re-authoring op"). An agent can distinguish rewrite_script from author_op/run_op without opening schemas.

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?

Explicitly says when to use it (a brief spanning the piece, e.g. act-level rhythm changes) versus when not (single scene → its own re-authoring op). It also gives the operational conditions: async, poll status by run_id, confirm_spend when the writer requires it, requires `write`.

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