Skip to main content
Glama

sonic_run_code

Execute Sonic Pi code in the managed runtime and collect newly generated events for real-time analysis and monitoring.

Instructions

Run Sonic Pi code in the managed runtime and return newly collected events.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYes
collect_msNo
buffer_nameNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior2/5

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

No annotations are provided, so the description must carry the full burden of behavioral disclosure. It mentions returning 'newly collected events' but does not explain side effects (e.g., stopping current playback), error handling, asynchronous behavior, or the lifecycle of the runtime. This leaves significant behavioral ambiguity for a code execution tool.

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?

The description is a single sentence with no redundant words, making it highly concise. However, it is perhaps too terse given the tool's complexity, but this dimension rewards efficient wording, not completeness. The structure is acceptable for a short description.

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

Completeness2/5

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

Given the tool's complexity (3 parameters, output schema, and no annotations), the description is insufficient. It does not explain what 'newly collected events' are, how the code is executed, or the purpose of the optional parameters. The description would be more complete if it clarified the runtime behavior and parameter usage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, meaning the input schema provides only parameter names. The description does not mention any of the three parameters. While 'code' is self-explanatory, 'collect_ms' and 'buffer_name' are completely unexplained, and the description adds no value to parameter understanding.

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 description clearly states a specific verb and resource: 'Run Sonic Pi code in the managed runtime'. It also mentions the return of 'newly collected events', which distinguishes it from sibling tools like sonic_play_file or sonic_send_cue. This gives a precise sense of what the tool does.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It does not mention any prerequisites, exclusions, or situations where another tool would be more appropriate. The presence of sibling tools like sonic_read_events and sonic_send_cue makes this lack of differentiation problematic.

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/WEEZZ-admin/sonic-pi-mcp'

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