Skip to main content
Glama

query

Run structured NFL queries with explicit term definitions, returning SQL, matched samples, and season coverage for accurate data analysis.

Instructions

Run a structured query. plan is {entity, where, seasons, game_types, group_by, metrics, order_by, limit, allow_partial_coverage, sample_rows, question}; where clauses are {"term": name} for concepts, {"attr": name, "op": …, "value": …} for raw fields, and {"not"|"any_of"|"all_of": …} to combine. Every fuzzy word in the user's question must be a term. If a term has no definition this tool returns unresolved_term — do not replace it with an attribute rule to get past the error; call propose_definition and ask the user. The result includes definitions_used, the seasons actually covered, a sample of matched rows and the SQL; report the definitions and coverage alongside the number, because the number is not meaningful without them. If warnings mention evidence unavailable for early seasons, say so.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
planYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/5.0
Behavior5/5

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

With no annotations, the description carries the full behavioral burden. It discloses the unresolved_term return, the instruction not to work around it, the result contents (definitions_used, seasons covered, sample, SQL), the caveat that the number is not meaningful without definitions/coverage, and the meaning of warnings.

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 every sentence adds necessary operational detail. Inline code keeps the plan and where syntax scannable, and the warnings/error-handling instructions are placed where they matter.

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 complex query tool with one unstructured parameter, the description provides solid coverage of plan structure, error handling, result contents, and warning interpretation. It remains slightly vague about allowed operator values for op and the exact semantics of each metric/grouping field, though an output schema may fill that gap.

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%, but the description fully compensates by enumerating every plan field and explaining where-clause syntax for concepts, raw fields, and boolean combinators. Without this, the single opaque plan object would be unusable.

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 clearly states the tool runs a structured query and explains the plan object, so the agent knows its core function. It does not explicitly contrast itself with sibling tools like raw_sql or explain_query, but the structured query framing distinguishes it reasonably.

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?

The description gives concrete guidance: every fuzzy word must be a term, and on unresolved_term the agent should call propose_definition and ask the user rather than substituting an attribute rule. It does not explicitly state when to choose query over raw_sql or explain_query, but the error-handling guidance is strong.

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