Skip to main content
Glama

Generate a spoken line and add it as a sound

add_speech

Convert text to speech offline, attach it to a Scratch sprite as a sound, and get duration plus mouth-loop count to time talking animation.

Instructions

Synthesizes speech with the machine's offline text-to-speech engine and attaches it to a sprite as a Scratch sound — no network, no file needed. Returns the sound's duration and a ready-made mouth-loop repeat count, so the talking animation can be timed to the audio. Use {"play_sound": name} (not play_sound_until_done) before the mouth loop so the animation runs while the audio plays.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNoSound name used by play_sound. Defaults to a slug of the text
rateNoSpeed multiplier, 0.5 (slow) to 2.0 (fast), default 1
textYesThe line to speak. Split long speeches into one call per line
voiceNo"male", "female", or part of a voice name such as "george". Call list_voices to see what exists
targetYesThe sprite that speaks. Put the sound on the speaking sprite, not the Stage
volumeNo0 to 100, default 100
trim_silenceNoTrim dead air at both ends, default true

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/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. It discloses the side effect (attaches the sound to a sprite), the return values (duration and mouth-loop repeat count), and the offline/no-network requirement. It also gives a behavioral tip about playback sequencing. It does not mention reversibility or permissions, but these are minor for a TTS tool.

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?

The description is three sentences, each earning its place: purpose, behavior/return, and a usage tip. It is front-loaded with the core action, contains no redundant phrasing, and is easily scannable.

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?

The description covers purpose, behavior, return values, and even a usage tip, which is quite complete for a tool with 7 parameters and no output schema. It lacks explicit error conditions or prerequisites, but for a creative TTS tool these are not essential. The offline/no-network note and the sprite attachment are sufficient context.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents all seven parameters. The description does not add parameter-level meaning beyond what the schema provides, though it does mention the return value context (mouth-loop repeat count) which relates to how the parameters are used. This matches the baseline for high coverage.

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 states a specific action: 'Synthesizes speech with the machine's offline text-to-speech engine and attaches it to a sprite as a Scratch sound'. It clearly distinguishes this from add_sound (which likely handles existing audio files) and list_voices, making the purpose unambiguous.

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?

The description provides a clear usage tip for the generated sound ('Use {"play_sound": name} (not play_sound_until_done) before the mouth loop'), but it does not explicitly state when to choose add_speech over alternatives like add_sound. The offline/no-file characteristic implies a distinction, but it is not articulated as a comparison.

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