Skip to main content
Glama

Prepare Speech Script

beatra.speech.prepare_script
Idempotent

Use before beatra.speech.synthesize to make speech sound natural and human. Beatra's Smart Voice Director reads the text and the user's optional instructions, then returns a script that is ready to synthesize, written in Beatra speech markup for the target voice and model: emotion, performance, sound effects, pauses and pronunciation. It never changes the words. Without voice or model it recommends one, with alternatives, each with a name, a preview link and a reason. Call beatra.speech.synthesize with each returned script's synthesis object as the arguments, unchanged, plus your own client_request_id; a script whose synthesis is null cannot be synthesized as is (read warnings). To try another voice within two days, call again with the same arguments, changing only voice (and model if needed): the earlier reading is reused and not charged again. This asynchronous task consumes Beatra credits: successful completion is charged afterward from actual tokens; nothing is charged when the result has directed false or reuses an earlier reading. To start, the balance must cover Beatra's estimate for the text (per 1,000 characters, counting at least 1,000) plus that of any other Smart Voice Director task in progress, also when an earlier reading is reused; an insufficient_balance refusal states the amount needed. An account runs at most 2 Smart Voice Director tasks at a time. Submit exactly once, then poll with beatra.tasks.get. Reuse client_request_id only for an identical retry.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "input": "<input>",
      "client_request_id": "<client_request_id>"
    },
    "name": "beatra.speech.prepare_script"
  }
}

Input Schema

NameRequiredDescriptionDefault
inputYesText to perform, in any supported language, 1 to 50,000 characters. It may already contain Beatra speech markup such as {pause 0.5} or {pron 行 hang2}; the Smart Voice Director keeps it and only adds to it. The words themselves are never changed.
modelNoOmit unless the user requests a model. Same values as model in beatra.speech.synthesize; auto or omitted: resolved from the voice, or recommended together with the voice.auto
voiceNoOptional voice to perform for: a voice_id from beatra.voices.list, a preset or one of your own cloned voices. Same meaning as voice in beatra.speech.synthesize. Omit it to let the Smart Voice Director recommend a voice.
contextNoOptional, advanced: the text around the input when a long text is directed in parts, used only to understand the tone. It is not annotated, read aloud or returned. The end of before is also suggested as previous_text when the target model supports it.
languageNoLanguage of the input as a BCP-47 tag. Usually omit it (auto, the default): the language is detected. Send it only when the user names the language or a dialect the text cannot show, such as Cantonese (yue).auto
instructionsNoOptional requirements in natural language, in any language, up to 2,000 characters, for example "a bit suspenseful, whisper the last line". Without them the Smart Voice Director performs the text by its meaning.
client_request_idYesStable retry identity for this billable operation. Reuse only for the exact same generation arguments.

Output Schema

NameRequiredDescriptionDefault
taskNo
errorNo
usageNo
statusNo
billingNo
task_idNo
terminalNo
artifactsNo
resolved_modelNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare the safety profile (readOnly false, destructive false, idempotent true), yet the description adds substantial context the annotations cannot: it is asynchronous, billed from actual tokens after success, free on directed=false or reuse, requires balance for the estimate, caps at 2 concurrent tasks, and returns an insufficient_balance refusal naming the amount. That is unusually rich disclosure, though the polling/credit sentences are dense enough that an agent may need to re-read them.

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 purpose and the synthesize handoff are front-loaded, and nearly every sentence carries operational information. However, it is delivered as one dense paragraph where billing, concurrency, retry identity and error handling run together, so structure (bullets or short labeled sentences) could improve scanability.

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?

For an async, billable, open-world task with seven parameters, the description covers ordering, return handling, billing, concurrency, retry identity, polling and a specific failure mode. With an output schema present, it need not explain return values, and nothing an agent needs to invoke it correctly appears missing.

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% and every parameter already carries a detailed description, so the schema does the heavy lifting. The description adds only marginal parameter-level meaning, chiefly that omitting voice/model triggers a recommendation with alternatives, which the schema also states. Baseline 3 is appropriate.

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 names a specific verb and resource (direct the text into a synthesis-ready speech script in Beatra markup) and explicitly scopes what it does not do ("It never changes the words"). It also positions itself relative to the sibling beatra.speech.synthesize, so an agent can distinguish the two without opening either schema.

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?

It states the ordering constraint ("Use before beatra.speech.synthesize"), the fallback when voice/model are omitted, the two-day voice-retry path that reuses the earlier reading for free, and the exclusion that a script with null synthesis cannot be synthesized as is. Alternatives and when-not conditions are both explicit.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources