Skip to main content
Glama

Create a new script in the file

patchwork_add_script

Create a new FileMaker script from plain-text steps or XML, with each step verified after the change and a new version made for undo. Use it to add scripts; edit existing ones with set or append steps.

Instructions

Create a new script, empty when steps is omitted. Each step is re-read after the change, and the version is dropped with an error if one came back different. To change a script that exists, use patchwork_set_steps or patchwork_append_steps. Text is understood for: # (comment), Allow User Abort, Beep, Close Window, Commit Records/Requests, Delete Record/Request, Else, Else If, End If, End Loop, Exit Loop If, Exit Script, Freeze Window, Go to Layout, Halt Script, If, Loop, New Record/Request, Perform Script, Refresh Window, Set Error Capture, Set Field, Set Variable, Show All Records, Show Custom Dialog. For any other step, get a model with patchwork_show kind=step and send XML. 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": {
      "name": "<name>"
    },
    "name": "patchwork_add_script"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYesName of the new script.
stepsNoOne 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.
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
Behavior5/5

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

Annotations only declare readOnly=false, idempotent=false and destructive=false; the description adds substantive behavior on top: steps are re-read after the change and the version is dropped with an error on a mismatch, a new version is created, and patchwork_undo reverses it. That concurrency-conflict and versioning disclosure is exactly the kind of context annotations cannot carry.

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?

Purpose, alternatives and versioning semantics are front-loaded and waste-free. The long inline enumeration of ~28 step names is useful but bulky and could have been compressed into a single pointer, which slightly dilutes the middle of the description.

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?

With no output schema, the description still covers the important outcomes: error on concurrent modification, new version creation, and undo. It does not state what a successful call returns (script name, version id, or dry-run path beyond the schema's note), leaving a small gap for a mutation tool.

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 would be 3, but the description adds real meaning: omitting 'steps' yields an empty script, and it enumerates which step types can be supplied as plain text versus requiring <Step> XML. It does not add anything for dry_run or message, which the schema already explains well.

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?

The opening sentence gives a specific verb and resource ('Create a new script') plus the key edge case ('empty when steps is omitted'), which no sibling name alone would reveal. It also explicitly names patchwork_set_steps and patchwork_append_steps as the tools for existing scripts, so an agent can distinguish create-vs-modify 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?

The description routes the agent three ways: create a new script here, use patchwork_set_steps or patchwork_append_steps to change an existing one, and use patchwork_show kind=step to obtain a model for unsupported steps. It even bounds the supported text vocabulary so the agent knows when the fallback applies.

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