Skip to main content
Glama

gen_sfx

Generate precise 10-200ms game sound effects like jumps, coins, and lasers. Returns a reproducible 44.1kHz WAV path without using GPU memory.

Instructions

合成一枚 sfxr/jsfxr 风格的游戏音效(纯程序化, 不用模型), 返回 WAV 路径。

不要用 generate_music 做音效: 那是扩散模型, 出来的是几十秒的宽带糊音。游戏音效 是 10~200ms 的瞬态, 要精确、即时、可复现 —— 本工具毫秒级出结果, 同 seed 逐字节可复现, 而且完全不占显存。

参数: preset: jump / coin / hit / explosion / powerup / laser / select / hurt seed: 随机种子。给了就在 preset 周围抖动参数(不是抖采样点), 同 seed 结果完全相同; 不给则严格使用 preset 的原始参数。 base_freq: 覆盖基频 Hz (noise 波形下是采样保持的刷新率) wave: 覆盖波形 square / saw / sine / triangle / noise overrides: 覆盖任意合成参数的字典, 例如 {"freq_slide": -3.0, "release": 0.4, "lpf": 0.5, "duty": 0.25} 可覆盖的完整字段名和默认值: 调 sfx_presets()

返回: 44.1kHz 16bit 单声道 WAV 的本机路径。结构化返回里的 params 是这一枚音效 用到的全部合成参数 —— 拿它加一点改动再调一次, 就能做出一整组同族音效。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
seedNo
waveNo
presetNoselect
base_freqNo
overridesNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYes
pathNo
seedNo
waveNo
errorNo
paramsNo
presetNo
durationNo
warningsNo
base_freqNo
error_codeNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.5.5

TDQS

A4.7/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses millisecond-level latency, byte-identical reproducibility under a fixed seed, no model/VRAM usage, and the exact output format (44.1kHz 16bit mono WAV path). It stops short of stating file-write/overwrite behavior or where artifacts land, so not a 5.

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 purpose then contrast, then a clean params/return block; every section earns its place. Minor redundancy in reiterating seed reproducibility ('同 seed 结果完全相同' and '同 seed 逐字节可复现'), but overall tight and well organized.

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 5 params with zero schema coverage, a nested overrides object, an existing output schema, and no annotations, the description is complete enough for correct invocation: all inputs are explained, the output artifact and its structured params are described, and reproducibility semantics are stated.

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

Parameters5/5

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

Schema coverage is 0%, so the description must compensate and it does: it enumerates preset and wave values, explains seed semantics precisely (jitter around the preset's parameters, not sample points; identical seed yields identical output), defines base_freq incl. its meaning under noise, and points to sfx_presets() for valid overrides keys with a worked example.

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 (synthesize a programmatic sfxr/jsfxr-style game sound effect) and immediately distinguishes itself from the sibling generate_music. An agent can tell exactly what it produces and what it does not.

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?

Explicitly names the alternative (generate_music) and the condition that rules it out: diffusion music is tens-of-seconds broadband mush, whereas game SFX are 10~200ms transients needing precision and immediacy. This is textbook when-to-use/when-not guidance.

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