Skip to main content
Glama

edit_pattern

Change the current Strudel session pattern by writing new code, appending, inserting at a line, replacing text, or clearing the editor.

Instructions

Mutate the current session pattern. mode=write replaces the editor contents (default; mirrors the old write tool exactly, including optional pattern validation and auto_play). mode=append concatenates code after the current pattern with a newline. mode=insert places code at the given line position. mode=replace runs a single string-replace from search to replace. mode=clear empties the editor. Example: edit_pattern({ mode: "write", pattern: "s("bd")", auto_play: true }). For reading the editor without mutating it use get_pattern; for the on-disk pattern catalog use pattern_store.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNoWhich edit operation to perform (default: write)
patternNoPattern code (mode=write)
codeNoCode to append/insert (mode=append/insert)
positionNoLine number (mode=insert)
searchNoText to replace (mode=replace)
replaceNoReplacement text (mode=replace)
auto_playNoStart playback after write (mode=write only, default: false)
validateNoValidate pattern before write (mode=write only, default: true)
session_idNoOptional session ID (#108). Omit to use default session.
Behavior4/5

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

No annotations provided, but description fully discloses mutation behavior, defaults (mode=write, validate=true, auto_play=false), and mode semantics. No contradictions.

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?

Description is moderately long but efficiently structured: first sentence general, then mode-by-mode, example, sibling differentiation. Every sentence serves a purpose; no filler.

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?

Given 9 parameters, 0 required, 5 modes, and no output schema, the description covers all modes, all parameters in context, and includes an example. No gaps remain.

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%, baseline 3. Description adds value by associating each parameter with the relevant mode (e.g., pattern for write, code for append/insert), beyond schema's standalone descriptions.

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?

Describes specific verb 'mutate' for 'current session pattern' and lists all five modes. Distinguishes from siblings get_pattern (reading) and pattern_store (on-disk catalog) explicitly.

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?

Provides explicit guidance per mode with parameters and an example. Tells when not to use: use get_pattern for reading, pattern_store for catalog.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/williamzujkowski/live-coding-music-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server