Skip to main content
Glama

Optimize Track Order

am_optimize_order
Read-onlyIdempotent

Compute a proposed track order that balances audio transitions with a narrative arc, returning a suggested sequence without modifying the playlist.

Instructions

Compute a proposed order after the LLM has selected the songs and narrative blocks. It balances adjacent audio transitions with a chosen qualitative arc, returns an order without writing, and may fetch cached remote features; it must not choose songs or judge theme fit. / 中文:为一批曲目算出更好的顺序。这是本项目唯一会排序的工具——am_analyze_flow 只诊断(告诉你哪里有 2 处慢歌相邻、形状是 Icarus),不提供修法。这里用模拟退火在四条相邻硬规则(不要两首慢歌相邻 / 不要「只慢一点」/ 相邻不该在 tempo 与 key 上同时相似 / 不要 BPM 无理由大跳、能量骤变)与选定叙事弧之间取平衡。只读:只返回建议顺序,不动任何歌单;把返回列表按原顺序交给 am_create_playlist 即可。因为需要每首的 BPM/调性,首次会联网抓特征(之后走缓存)。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
arcNo目标叙事弧,默认 man-in-a-hole(先落再起)。用 cinderella 表示起-落-起,等等
isrcsNotracks/blocks 是否按 ISRC 精确匹配,默认 false
blocksNo分组排序:每个子数组是一个乐章/段落,**段落之间的先后顺序保持不动**,只在段落内部重排。想保留叙事结构时用它(与 tracks 二选一)
tracksNo要排序的曲目,每项 '歌名 - 艺人'(配 isrcs=true 时填 ISRC)
refreshNo忽略音频特征缓存重抓,默认 false
playlistNo要重排的现有歌单名或 p.xxxx ID(与 tracks/blocks 二选一)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.8/5.0
Behavior5/5

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

The description states it 'returns an order without writing' and is 'read-only', consistent with readOnlyHint and destructiveHint, but adds meaningful behavior not visible in annotations: it may fetch remote audio features on first use and cache them afterward, and it uses simulated annealing with four hard rules balanced against a narrative arc. This gives the agent a realistic model of side effects and computation.

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 English opening is compact and the Chinese expansion adds dense, non-redundant detail about sibling differentiation, hard constraints, cache behavior, and the downstream workflow. It is long, but every sentence earns its place; the main cost is bilingual duplication of the core concept.

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 a tool with six optional parameters and no output schema, the description covers the full lifecycle: when to invoke it, what it must not do, what algorithm it uses, what side effects it has, how the output should be consumed, and how it relates to a sibling tool. Little is left for the agent to infer.

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; the description adds value by clarifying that tracks/blocks are LLM-selected inputs rather than something the tool picks, that arc is a qualitative tradeoff against hard ordering rules, and that feature fetching/caching underlies the refresh and network behavior. It does not enumerate every parameter, but the schema already handles that.

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 opens with a specific verb and resource: 'Compute a proposed order' for songs and narrative blocks. It further distinguishes this tool from siblings by stating it is 'the only tool that sorts' and explicitly says it 'must not choose songs or judge theme fit', eliminating ambiguity about its exact scope.

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 tells the agent exactly when to use the tool: 'after the LLM has selected the songs and narrative blocks'. It also names the alternative, am_analyze_flow, as diagnostic-only and says it doesn't provide fixes, so the agent knows to come here for reordering rather than diagnosis. The workflow note about passing the returned list to am_create_playlist further anchors usage.

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