Skip to main content
Glama
m4l MCP server

m4l MCP server

patch_edit_batch

Batch-edit Max for Live devices and .maxpat files atomically; if any operation fails, every change rolls back.

Instructions

Apply many edits atomically (all roll back if one fails). Each op is a dict with "op": add_box (same fields as patch_add_box, plus "as": "alias"), set (box, set, unset), remove_box (box), connect (src, outlet, dst, inlet), disconnect (src, outlet?, dst?, inlet?). Ops may override "file". Later ops refer to boxes added earlier as "$alias", e.g. [{"op":"add_box","text":"t b b","as":"t"},{"op":"connect","src":"$t","outlet":0,"dst":"obj-5","inlet":0}].

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": {
      "path": "<path>",
      "ops": "<ops>"
    },
    "name": "patch_edit_batch"
  }
}

Input Schema

NameRequiredDescriptionDefault
opsYes
fileNo
pathYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden. It does disclose a genuinely valuable trait no structured field provides — all-or-nothing rollback and alias resolution across ops — but says nothing about prerequisites (must the patch file exist?), permissions, how failures are reported, or what is returned, leaving the mutation profile incomplete.

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?

Front-loads the atomicity guarantee, then gives the op grammar and finishes with a concrete example. Every clause carries information an agent needs; nothing is padding despite the density.

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

Completeness3/5

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

For a polymorphic batch-mutation tool with no annotations and no output schema, the op shapes are covered well, but 'path' is undefined, the return/failure reporting is unexplained, and the relationship between 'file' and 'path' is only teased by 'Ops may override "file"'. Adequate but with real holes for a complex 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 description coverage is 0% and the ops array is unconstrained (additionalProperties), so the description is the only documentation of the op vocabulary — it enumerates op types, their fields, the '$alias' back-reference mechanism, and the per-op 'file' override, plus a worked example. It falls short on 'path' (never explained) and only hints at the top-level 'file' via the override sentence, so not a 5.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb+resource ('Apply many edits') and immediately names the atomic/rollback scope, which distinguishes it from the single-edit siblings like patch_add_box and patch_connect. It does not explicitly name a sibling, but the 'many edits' framing makes its role obvious.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The atomicity note ('all roll back if one fails') implies when this tool is preferred over a sequence of single-edit calls, but the guidance is only implied — there is no explicit 'use this instead of N individual calls when...' statement or exclusion. An agent can infer the use case but must do the work.

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