Skip to main content
Glama

Trim a WAV audio file

trim_audio
Read-onlyIdempotent

Trim a WAV audio file to a time range with optional fade in and out, returning a 16-bit PCM WAV as base64. Only WAV is accepted; the web UI handles MP3/OGG/M4A.

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": {
      "file": "<file>",
      "startSec": "<startSec>",
      "endSec": "<endSec>"
    },
    "name": "trim_audio"
  }
}

Input Schema

NameRequiredDescriptionDefault
fileYes
endSecYesTrim end in seconds, after startSec.
startSecYesTrim start in seconds.
fadeInSecNoLinear fade-in length in seconds.
fadeOutSecNoLinear fade-out length in seconds.

Output Schema

NameRequiredDescriptionDefault
dataYesTrimmed audio as a 16-bit PCM WAV, base64.
bytesYesWAV file size in bytes.
sampleRateYesSample rate in Hz.
durationSecYesDuration of the trimmed audio in seconds.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / additionalProperties
      Added value: +false
  2. Added

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, and openWorldHint, so the safety profile is covered. The description adds meaningful behavior beyond them: the exact output codec and container (16-bit PCM WAV) and the transport encoding (base64), plus the input-format restriction. It does not cover edge behavior such as endSec exceeding the source duration or whether fades exceeding the range are clamped, which keeps it below 5.

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?

Two sentences, front-loaded with the operation and output contract, then the format constraint. Every clause adds information an agent needs; nothing is padded or redundant.

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?

With an output schema present and 80% schema coverage, the description need not restate return values, and it correctly focuses on the format restriction and output encoding. Minor gaps remain around validation edge cases (fade length vs. range, endSec beyond file length) for a tool with nested input objects and a 10 MB cap, but nothing essential for correct invocation is 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 80%, so the schema already documents every parameter including fade linearity and the URL/data/filename sub-fields. The description's only added parameter meaning is that fades are optional; it repeats rather than extends the schema. Baseline 3 applies when the schema carries the parameter burden.

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 gives a specific verb and resource ("Trim a WAV audio file"), states the operation scope ("to a time range with optional fade in and out"), and names the exact output encoding ("16-bit PCM WAV as base64"). The constraint "Only WAV is accepted; the web UI handles MP3/OGG/M4A" makes the boundary clear enough that an agent can tell this apart from generic convert/compress tools without opening the schema.

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?

There is a clear precondition boundary: only WAV input is accepted, and other formats belong to the web UI. However, there is no explicit when-to-use guidance versus alternatives, and no note about what to do if a caller supplies MP3/OGG/M4A (convert first, reject, etc.). Usage is implied rather than spelled out.

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.