Skip to main content
Glama

playlist_expression_algebra

Combine playlists using set algebra—union, intersection, difference—to build a new playlist from existing ones. Enter an expression like A ∪ (B ∩ C) − D and name the result.

Instructions

Mini set-algebra over playlists: REF ∪ (REF ∩ REF) − REF → NEW playlist. Operators: ∩ (binds tightest), then ∪ and − left-assoc; ASCII aliases | + for union, & for intersection. Refs are playlist IDs or spotify:playlist: URIs; results dedupe preserving first-seen order. Quota: 🟢 N GETs + 1 write.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
publicNoPublic visibility for the new playlist. Default: private
dry_runNoPreview only: validate inputs and describe exactly what would change without performing it
expressionYesSet expression, e.g. "37i9dQZF1DXcBWIGoYBM5M ∪ (4bKpVbPAsKv0aSsbIm2Ggt ∩ 6mtXbPAsKv0aSsbIm2Ggt) − 1a2B3cD4e5F6g7H8i9J0kL". Operators: ∪ (or | or +) union, ∩ (or &) intersection, − (or - or –) difference; parentheses for grouping.
target_nameYesName for the NEW playlist holding the result
response_formatNo'concise' = human prose, 'detailed' = more fields in prose, 'json' = raw API objectconcise
Behavior4/5

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

With no annotations, the description carries the behavioral burden and does so well: it discloses that a new playlist is written, that results are deduplicated preserving first-seen order, that operator precedence is fixed, and even gives a quota hint of N GETs plus 1 write. It stops short of explaining overwrite semantics or exact failure behavior, but the key side effects are visible.

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?

The description is dense but efficient: it front-loads the core formula, then covers operators, aliases, ref types, dedupe behavior, and quota in just four short sentences. Every sentence earns its place with no padding.

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 tool with 5 parameters and no output schema, the description covers the hardest part—the expression language—completely enough to invoke the tool correctly. The schema covers target_name, public, dry_run, and response_format. The only notable omission is guidance on selecting this tool over the many similar playlist-combination siblings.

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 real value beyond the schema: it explains accepted ref forms (playlist IDs or spotify:playlist URIs), operator aliases, precedence, and dedupe ordering. This materially helps an agent construct a valid expression parameter.

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 clearly identifies a specific resource and operation: a set-algebra expression over playlist references that produces a NEW playlist. The operator formula and precedence rules make it unambiguous and distinguish it from single-operation siblings like playlist_union or playlist_intersection.

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?

Usage is implied by the set-algebra framing and the expression syntax: an agent can infer to use this when a request asks to combine playlists with ∪/∩/− operations. However, there is no explicit statement about when NOT to use it or which simpler sibling tool to prefer for a single union or intersection.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/NovaLux12/spotify-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server