Skip to main content
Glama

compare_audio

Compare reference and rendered audio to measure timing, level, bands, chroma, and envelope differences, exposing delay and gain mismatches without concealing tempo errors.

Instructions

Compare reference and rendered audio by timing, level, bands, chroma and envelope.

Files need matching channel counts. Candidate resampling and bounded constant
alignment are reported; no time warp conceals tempo errors. Positive delay means
candidate audio arrived later. Gain compensation is only for comparison, and
waveform error is phase-sensitive, not a musical quality or leakage score.
Poll get_audio_job; outputs and optional residual live in a unique run.

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": {
      "reference_path": "<reference_path>",
      "candidate_path": "<candidate_path>",
      "output_dir": "<output_dir>"
    },
    "name": "compare_audio"
  }
}

Input Schema

NameRequiredDescriptionDefault
confirmNoTrue carries the removal out. False changes nothing and returns a report of what the call would remove, which is how to look before committing to it.
output_dirYesParent directory for a unique audio run.
end_secondsNoExclusive end in source-file seconds.
start_secondsNoStart in absolute source-file seconds.
candidate_pathYesLocal mono/stereo audio file path (WAV/FLAC).
reference_pathYesLocal mono/stereo audio file path (WAV/FLAC).
write_residualNoWrite the gain-aligned, phase-sensitive difference as a FLOAT WAV.
max_alignment_msNoDelay search radius in milliseconds; zero disables alignment.
extra_reference_pathsNoFurther reference stems added to reference_path sample by sample, to compare a group with the sum of the stems it rebuilds rather than one of them.
candidate_start_secondsNoCandidate-file seconds corresponding to the reference section start.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / extra_reference_paths
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "type": "string"
      +      },
      +      "maxItems": 32,
      +      "type": "array"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Further reference stems added to reference_path sample by sample, to compare a group with the sum of the stems it rebuilds rather than one of them.",
      +  "title": "Extra Reference Paths"
      +}
  2. Added

TDQS

A3.9/5.0
Behavior5/5

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

Goes well past the supplied annotations by disclosing that candidate resampling and bounded constant alignment are reported, that no time warp is applied (so tempo errors surface), the sign convention for delay, that gain compensation is comparison-only, and that waveform error is phase-sensitive rather than a quality/leakage metric. It also explains that outputs and optional residual are isolated in a unique run directory, so no overwrite risk is implied. That is unusually rich interpretive and side-effect context for a non-read-only, non-idempotent tool.

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 the core comparison statement, then caveats, then workflow, so an agent can stop reading early if it only needs the purpose. The prose is dense and slightly telegraphic, but nearly every sentence carries a distinct constraint or interpretation rule.

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?

For a 10-parameter, non-idempotent tool with an output schema and full schema coverage, the description supplies the behavioral and interpretive context the schema cannot express, including the follow-up job poll. The one gap is that it never reconciles the stray 'confirm'/'removal' semantics present in the schema, which could mislead an agent about whether this call deletes anything.

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 coverage is 100%, so the baseline is 3; the description only marginally extends it by fixing the sign convention for alignment delay and clarifying that the residual is gain-aligned and phase-sensitive. It adds nothing about start/end_seconds, candidate_start_seconds, or extra_reference_paths, and it does not address the 'confirm' parameter, whose schema text describes a removal operation that is inconsistent with a comparison tool.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb ('Compare') and both resources ('reference and rendered audio'), then enumerates the measured dimensions (timing, level, bands, chroma, envelope), which implicitly separates it from the narrower compare_spectrum. It stops short of explicitly naming a sibling to contrast with, so it lands just below the top mark.

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?

Gives a workflow instruction ('Poll get_audio_job') and a hard prerequisite ('Files need matching channel counts'), which is real usage context. However, it never states when to prefer this over compare_spectrum or analyze_audio, nor when not to use it, so the selection decision is left to inference.

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