Skip to main content
Glama

Apply Strategy Patch (Chunked)

tt_apply_strategy_patch_chunked
Destructive

Chunked tt_apply_strategy_patch, for an edit too large to send in one tool argument.

WHEN TO USE: only after a normal tt_apply_strategy_patch call could not be emitted in one piece. Before reaching for this, check whether rewrite does the job — moving a timeframe across a whole strategy is ~60 bytes with rewrite and hundreds of KB without it. Between rewrite and chunking, a large edit can normally be completed without asking the user to do it by hand.

PROTOCOL. Encode the WHOLE CALL as JSON — not the strategy:

{"strategy_id": 123,
 "patch": [ ...ops... ],        # optional when `rewrite` is given
 "rewrite": {"dimension": "timeframe", "from": "1m", "to": "5m"},
 "dry_run": true,
 "live_edit_confirmed": false}

base64(gzip(...)) it if you can compute that; plain JSON is accepted too (the decoder is tolerant — do NOT hand-write base64). Split the string into N pieces and send each with the same draft_id and total_chunks. Earlier calls return {status: "chunk_received", ...}; the final call runs the patch and returns exactly what tt_apply_strategy_patch returns.

Resending the same (draft_id, chunk_index) replaces that chunk — safe to retry. Drafts are GC'd 5 minutes after the last write. Assembly is one-shot: if the patch itself is rejected, re-upload the chunks.

LIVE TEMPLATES: a non-dry-run edit to a deployed, subscribed or public template refuses once with LIVE_EDIT_CONFIRMATION_REQUIRED. After the user explicitly agrees, re-upload the chunks with live_edit_confirmed=true (this argument on the final chunk, or the same key inside the JSON). Never set it on your own initiative.

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": {
      "draft_id": "<draft_id>",
      "chunk_index": "<chunk_index>",
      "total_chunks": "<total_chunks>",
      "chunk": "<chunk>"
    },
    "name": "tt_apply_strategy_patch_chunked"
  }
}

Input Schema

NameRequiredDescriptionDefault
chunkYes
draft_idYes
chunk_indexYes
total_chunksYes
live_edit_confirmedNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior4/5

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

Goes well beyond the annotations: discloses chunk-resend replacement semantics, 5-minute draft GC, one-shot assembly that must be re-uploaded if the patch is rejected, intermediate {status: "chunk_received"} responses, and the LIVE_EDIT_CONFIRMATION_REQUIRED refusal path with the exact opt-in flow. It does not explicitly reconcile 'safe to retry' on chunks with the destructive/non-idempotent annotation on the assembled patch, which is the one place an agent could misread the safety 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 purpose then WHEN TO USE, with labeled PROTOCOL and LIVE TEMPLATES sections and an inline example payload that carries information rather than filler. It is long, but nearly every sentence (GC window, retry, one-shot assembly, confirmation rule) prevents a concrete failure mode.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a destructive, multi-call upload protocol with no output schema, it covers encoding, ordering groups, retry, expiry, failure recovery, and authorization escalation. Remaining gaps are the chunk_index base/ordering convention and the fact that the final return shape is only defined by reference to tt_apply_strategy_patch.

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?

With 0% schema coverage the description must carry all parameter meaning, and it does: draft_id groups chunks, chunk_index identifies a replaceable slot, total_chunks must be consistent, and live_edit_confirmed can be passed either as a top-level argument on the final chunk or inside the JSON. It never states whether chunk_index is zero- or one-based or what value total_chunks must match, which is a real gap.

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 and immediately frames it as the chunked variant of tt_apply_strategy_patch, scoped to edits too large for one tool argument. An agent can distinguish it from the plain patch tool and from `rewrite` without opening any 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?

Explicit WHEN TO USE gate: only after a normal tt_apply_strategy_patch call could not be emitted in one piece, plus a directive to check whether `rewrite` suffices first, with a concrete size comparison (~60 bytes vs hundreds of KB). This names both alternatives and the condition that selects each.

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