Skip to main content
Glama

sql

Read-only

Run read-only SQL queries on your local AnkiWeb database for ad-hoc analysis, aggregations, and joins across synced resources. Requires sync first.

Instructions

Run read-only SQL against local database. Use for ad-hoc analysis, aggregations, and joins across synced resources. Requires sync first.

Input Schema

NameRequiredDescriptionDefault
queryYesSQL query (SELECT or WITH...SELECT). Synced records live in resources(resource_type, id, data); filter by resource_type and use json_extract on data, e.g. SELECT json_extract(data,'$.name') FROM resources WHERE resource_type='card'.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, and openWorldHint=true, so the safety profile is largely covered. The description adds useful context by stating it operates on a local database, covers synced resources, and requires a prior sync. It does not disclose row limits, timeouts, cost, or error behavior for complex queries, which would be helpful for a SQL tool.

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?

Three short sentences, front-loaded with the core action, then usage scope, then prerequisite. Every sentence earns its place with no redundancy or filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a one-parameter SQL tool with no output schema, the description covers the essential prerequisites and scope. However, it does not mention constraints such as query timeout, row limits, or result shape. An agent could invoke it correctly, but would lack guidance on operational boundaries.

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?

There is only one parameter and schema description coverage is 100%, so the schema already carries the burden. The schema's query description is very rich, including table structure and an example using json_extract. The tool description adds no parameter-specific detail beyond the schema, so baseline 3 is appropriate.

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?

The description uses a specific verb and resource: 'Run read-only SQL against local database.' It also scopes the tool to 'synced resources' and 'ad-hoc analysis, aggregations, and joins,' which helps distinguish it from simpler search tools. However, it does not explicitly name siblings like search or export, so differentiation requires inference.

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?

It gives clear usage context: 'Use for ad-hoc analysis, aggregations, and joins across synced resources.' It also states the prerequisite 'Requires sync first.' It does not name alternatives or say when not to use SQL, so it falls short of explicit routing guidance.

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