Skip to main content
Glama
hlights33
by hlights33

query_collection

Read-only

Run read-only SQL SELECT against a local Discogs collection cache to answer questions without API calls.

Instructions

Run a read-only SQL SELECT against the local collection cache (max 500 rows). Use it to answer any question across the whole collection without API calls.

Tables and views (SQLite):

  • collection (view): instance_id, folder_id, folder, rating, date_added, fields, release_id, master_id, artist, title, year, labels, catnos, format, formats, genres, styles, country

  • wants (view): release_id, rating, notes, date_added, master_id, artist, title, year, labels, catnos, format, formats, genres, styles, country

  • releases: id, master_id, artist, title, year, labels, catnos, format, formats, genres, styles, country, details_fetched_at

  • release_labels: release_id, label_id, name, catno (one row per label on a release)

  • collection_items: instance_id, release_id, folder_id, rating, date_added, fields

  • item_fields: instance_id, field_id, name, value (e.g. name='Media Condition')

  • folders: id, name, count

  • tracks: release_id, position, title, artists, duration, seq (needs sync_release_details)

  • sync_meta: key, value labels, catnos, genres and styles are JSON arrays: use json_each, e.g. SELECT s.value AS style, COUNT(*) FROM collection, json_each(collection.styles) s GROUP BY 1 fields is a JSON object: json_extract(fields, '$."Media Condition"'). country and tracks are only populated after sync_release_details.

Input Schema

NameRequiredDescriptionDefault
sqlYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/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 safety is covered. The description goes further by adding the 500-row cap, clarifying that queries hit a local cache (no API calls), and flagging data-freshness dependencies on sync_release_details — real behavioral context beyond the annotations.

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 core purpose and row limit are front-loaded, and the table/column listing is dense reference material that earns its space for a SQL-writing tool. It is long, but the structure (intro, bulleted tables, JSON usage note, freshness caveat) keeps it navigable rather than padded.

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 no output schema, the description compensates by documenting the 500-row result limit and the columns each query can return, plus JSON-handling and freshness caveats. It stops short of describing the return shape (row objects) or error behavior on invalid SQL, which would round out completeness.

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

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0% and the single `sql` parameter is a bare string, so the description must carry the burden — and it does, enumerating every available table/view, its columns, the SQLite dialect, JSON array/object access patterns via json_each and json_extract, and worked examples. This is substantially more meaning than the schema provides.

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 ('Run a read-only SQL SELECT against the local collection cache') plus a hard constraint (max 500 rows), which clearly separates it from sibling tools like find_in_collection, search, or get_collection. An agent knows exactly what capability this exposes 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 Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives clear when-to-use context ('answer any question across the whole collection without API calls') and prerequisite conditions (country and tracks require sync_release_details). It does not explicitly contrast against siblings like find_in_collection or search, so the alternative-selection decision is left partly to inference.

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