Skip to main content
Glama
m4l MCP server

m4l MCP server

patch_add_box

Adds a box such as an object, message, comment, UI control, or Live parameter to a Max for Live patch or subpatcher, inferring inlet/outlet counts and registering parameters.

Instructions

Add a box. maxclass 'newobj' (object box, give text), 'message', 'comment', or a UI class ('live.text', 'live.dial', 'bpatcher', ...). In/outlet counts are inferred (Max-saved patch corpus, abstractions, subpatcher contents); pass them explicitly if unknown. patcher = subpatcher path to add into. attrs are extra box attributes (dotted keys allowed: 'saved_attribute_attributes.valueof.parameter_mmax'). Live parameters: live.* UI objects (and newobj text with '@parameter_enable 1') need parameter={'longname','shortname', optional 'type' (0 float,1 int,2 enum,3 blob),'mmin','mmax','enum', 'initial','initial_enable','unitstyle',...}; the box gets saved_attribute_attributes.valueof and is registered in the device's parameter registry for every instance of that patcher. id defaults to the next free obj-N.

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>"
    },
    "name": "patch_add_box"
  }
}

Input Schema

NameRequiredDescriptionDefault
xNo
yNo
idNo
fileNo
pathYes
textNo
attrsNo
widthNo
heightNo
patcherNo
maxclassNonewobj
numinletsNo
parameterNo
numoutletsNo
outlettypeNo
allow_renameNo
presentation_rectNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior4/5

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

With no annotations present, the description carries the full burden and does well: it discloses that in/outlet counts are heuristically inferred from a saved-patch corpus and may be wrong, that `id` defaults to the next free obj-N, and that live parameter objects get registered in the device's parameter registry for every instance of that patcher — a non-obvious side effect. It stops short of saying whether the box is added at a default position or what the call returns.

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 the purpose and maxclass vocabulary, then progressively narrower details; nearly every clause carries information an agent could not get from the schema. Some sentences are dense with unglossed Max jargon and the live-parameter sentence runs long, but there is no padding.

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 17-parameter mutation tool with no annotations and no output schema, the core creation semantics are covered well enough to invoke it correctly. Gaps remain: no mention of how returned/created box identity works beyond the id default, no position semantics, and six or so parameters are undocumented anywhere, which an agent must infer from titles alone.

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 0% across 17 parameters, so the description has to compensate, and it does for the semantically hard ones: `text`, `maxclass` values, `patcher`, `attrs` dotted-key syntax, `parameter` sub-keys with the type enum (0 float,1 int,2 enum,3 blob), and the inlet/outlet override parameters. It leaves geometry (x, y, width, height, presentation_rect), `file`, `outlettype`, and `allow_rename` completely unexplained.

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?

Opens with a specific verb+resource ("Add a box") and immediately enumerates the maxclass families it accepts, which tells an agent exactly what this creates. It does not explicitly contrast with siblings such as patch_box or patch_set_attrs, so sibling differentiation is left implicit.

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?

It gives conditional guidance for the main paths (give `text` for a newobj, use `patcher` for a subpatcher, supply explicit in/outlet counts when inference is unreliable), which is genuinely useful. However it never states when to prefer this over patch_edit_batch or patch_set_attrs, nor any prerequisites or ordering constraints.

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