Skip to main content
Glama
libsonare-mcp

libsonare-mcp

Official
by libraz

Call a libcantus theory function

theory_lookup
Read-only

Call one libcantus music-theory function by name, such as chord parsing, transposition or interval math, and get the library's result unchanged. Use it to compute theory values from plain data.

Instructions

Calls one libcantus music-theory function by its Python name with arguments by parameter name and returns the library's result unchanged under 'result' (libcantus's own camelCase keys). Covers chord and key parsing and spelling, scales, intervals, Roman numerals, chord scales, substitutions, key relations, transposition, note, MIDI and frequency conversion, instrument ranges, tempo and duration math, and generators that take plain data. List the functions and their parameters with music_catalog kind 'theoryOps'. Functions that need handles, callbacks or model instances are refused; use theory_analyze, theory_check or midi_compose for those. Example: {"op": "transpose_chord_symbol", "args": {"text": "Am7", "semitones": 2}}.

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": {
      "op": "<op>"
    },
    "name": "theory_lookup"
  }
}

Input Schema

NameRequiredDescriptionDefault
opYeslibcantus function name, e.g. 'parse_chord_symbol' or 'transpose_chord_symbol'; list them with music_catalog kind 'theoryOps'.
argsNoArguments by parameter name, as music_catalog kind 'theoryOps' lists them. An omitted optional parameter takes the library's own default; null is passed as null. A variadic parameter takes a JSON array. A 'bars' value is at most 128.
detailNo'concise' returns the summary and the most useful fields; 'full' returns all.concise

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, so the safety profile is covered; the description adds genuinely new behavior: the result is returned unchanged under a 'result' key using libcantus's own camelCase keys, and unsupported function classes are refused rather than executed. It does not say what a refusal looks like (error versus empty result), which keeps it below 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 the core mechanic, then discovery, then exclusions, then an example — a sensible order with no filler sentences. The long domain enumeration is dense but earns its place by telling the agent what the dispatcher can reach; it is the only passage that could be trimmed.

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?

No output schema exists, and the description compensates by describing the return envelope ('result', camelCase keys) and the two detail modes implied by the schema. For a single-dispatch, read-only tool with three well-documented parameters, nothing an agent needs in order to call it correctly is missing.

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

Parameters4/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, but the description adds dispatch-level meaning: 'op' is a Python function name discoverable via music_catalog kind 'theoryOps', and 'args' are keyed by parameter name with a concrete example mapping text/semitones. The omission/JSON-array/128-bar rules live in the schema, so no extra credit is warranted there.

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: 'Calls one libcantus music-theory function by its Python name with arguments by parameter name.' It then bounds the scope by enumerating the covered domains (chords, scales, intervals, transposition, MIDI/frequency conversion, generators) so an agent knows the surface it is dispatching into, and it explicitly contrasts itself with theory_analyze, theory_check and midi_compose.

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?

Gives the discovery path explicitly ('List the functions and their parameters with music_catalog kind theoryOps'), states when-not ('Functions that need handles, callbacks or model instances are refused; use theory_analyze, theory_check or midi_compose for those'), and provides a worked example. Both the when and the when-not are spelled out with named alternatives.

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