Skip to main content
Glama

Replace all the steps of a script

patchwork_set_steps

Replace every step in an existing FileMaker script by submitting the complete edited list; omitted steps are removed, unchanged lines keep their steps, and the result is validated and versioned.

Instructions

Replace all the steps of an existing script. Read the script with patchwork_show, edit the text, and send the whole text back: steps you leave out are removed. Lines left as they were keep their step exactly, whatever the step. Each step is re-read, and the version is dropped with an error if one came back different. To only add steps at the end, use patchwork_append_steps. Makes a new version; patchwork_undo reverses it.

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": {
      "script": "<script>",
      "steps": "<steps>"
    },
    "name": "patchwork_set_steps"
  }
}

Input Schema

NameRequiredDescriptionDefault
stepsYesOne step per line, as FileMaker shows them: Set Variable [ $n ; Value: 1 ], If [ $n > 0 ], Show Custom Dialog [ "Title" ; "Message" ; Buttons: "OK", "Cancel" ], End If, # comment. Or <Step> XML.
scriptYesExact name of the script to rewrite.
dry_runNoOnly write the patch file to .patchwork/ and return its path. Nothing is applied, no version is made.
messageNoWhat this change does, kept in the version log. Default: a short description of the change.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior4/5

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

Goes well beyond the annotations by disclosing that omitted steps are deleted, that unchanged lines retain their step identity, that every step is re-read and the version is aborted with an error if a re-read step differs, and that a new version is created that patchwork_undo can reverse. The only minor gap: 'destructiveHint: false' combined with silent removal of omitted steps could warrant an explicit note that the deletion is recoverable only through the version/undo path.

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

Conciseness5/5

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

Five short sentences, front-loaded with the action and its destructive scope, followed by the required workflow, the validation behavior, the sibling routing, and rollback. No filler; every sentence carries decision-relevant information.

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 mutating, non-idempotent tool with no output schema, the definition covers action, required workflow, validation failure mode, alternative tool, and reversal path. An agent has everything needed to invoke it correctly and to anticipate failure.

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, but the description adds real semantics for the dominant parameter: the whole text must be resent and anything left out is removed, which is not evident from the schema's format examples alone. dry_run and message are fully documented in the schema and are not elaborated further.

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 scope: 'Replace all the steps of an existing script.' Immediately distinguishes itself from the closest sibling by naming patchwork_append_steps for the append-only case, so an agent can choose 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?

Prescribes the full workflow (read with patchwork_show, edit the text, send the whole text back) and names explicit alternatives with their selection conditions: patchwork_append_steps for appending, patchwork_undo for reversal. When-to-use and when-not are both covered.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.