Skip to main content
Glama

Get drop-in JavaScript for sounds

get_js_code
Read-only

Generate a dependency-free JavaScript snippet that defines play functions for game sound effects, ready to paste into browser games and call after a user gesture.

Instructions

Return one self-contained JavaScript snippet (Web Audio, ~7 KB, no dependencies, no audio files) that defines play functions for several sounds. Best for browser games: paste it in and call e.g. playCoin() after a user gesture. Each sound is either {name, preset, seed} or {name, patch}.

Input Schema

NameRequiredDescriptionDefault
soundsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations only declare readOnlyHint=true; the description adds real behavioral context on top: no dependencies, no audio files, ~7 KB single snippet, and the requirement for a user gesture before playback. It does not mention the 50-item cap or what happens with larger requests, but the added disclosure is meaningful for a read-only generator.

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?

Three sentences, all load-bearing: output form first, usage second, input shape third. No hedging, no restating the title, and the size/dependency facts are packed parenthetically rather than as filler.

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?

There is no output schema, so the description must characterize the return value, and it does — a single self-contained snippet exposing play functions. For a one-parameter tool this is close to sufficient; only the absence of an upper-bound note (max 50 sounds) keeps it from full marks.

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?

With schema description coverage reported at 0%, the description carries the load by explaining the two shapes: "Each sound is either {name, preset, seed} or {name, patch}." That conveys the preset/patch alternative structure, which the JSON schema does not make explicit as an either/or. It still doesn't explain the seed round-trip with generate_sfx or the name-to-playCoin() mapping, so not a 5.

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?

States a specific verb and resource: "Return one self-contained JavaScript snippet (Web Audio, ~7 KB...)" and specifies it defines play functions for several sounds. The output form is distinct from what list_presets, generate_sfx, or render_patch would produce, so an agent can tell it apart from siblings without opening another schema.

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

Usage Guidelines4/5

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

Gives a clear use context — "Best for browser games: paste it in and call e.g. playCoin() after a user gesture" — which signals both the target scenario and the autoplay-gesture prerequisite. It stops short of naming alternatives or exclusion conditions (e.g. when to prefer generate_sfx or render_patch instead), which keeps it below a 5.

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

Deploy Server

Other Tools