Skip to main content
Glama

evaluate_queries

Evaluate generated SQL against ground-truth test cases to measure and improve query accuracy over time.

Instructions

Build and run an accuracy test suite for SQL generation on a data source. Behavior: action 'add_test' stores a question paired with ground-truth SQL; 'list_tests' shows them; 'remove_test' deletes one; 'run' scores generated SQL against the test cases; 'results' shows the latest run. Usage: use this to measure whether keyword maps and few-shot examples actually improve smart_query accuracy over time; test cases and runs are stored locally per data_source_id.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYesAction to perform
test_caseNoTest case to add (required when action=add_test)
test_case_idNoTest case ID to remove (required when action=remove_test)
timeout_secsNoPer-query execution timeout in seconds when action=run (1 to 300, default 30)
data_source_idYesData source ID
generated_sqlsNoList of SQL to evaluate (required when action=run)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv3.3.0
    • addedInput schema / properties / timeout_secs
      Added value: +{
      +  "default": 30,
      +  "description": "Per-query execution timeout in seconds when action=run (1 to 300, default 30)",
      +  "maximum": 300,
      +  "minimum": 1,
      +  "type": "integer"
      +}
  2. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It explains what each action does (stores, shows, deletes, scores, shows results) and notes that test cases and runs are stored locally per data_source_id. This is transparent about persistence and scope, though it does not detail side effects like whether run modifies stored data or whether results are overwritten.

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 concise—two sentences—and front-loads the core purpose. The action list is compact and informative, and the usage guidance is directly actionable without wasted words.

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 6 parameters and nested objects, the description covers the main behaviors and usage context well. It explains the actions, the data source scoping, and the intended evaluation use case. However, it does not describe the return format of 'results' or 'run', which could be important since there is no output schema. This is a minor gap given the tool's complexity.

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?

Schema description coverage is 100%, so the baseline is 3. The description adds some context by linking parameters to actions (e.g., test_case required when add_test, generated_sqls when run), but this largely repeats what the schema already states. No new semantic meaning is added beyond the schema.

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 states the tool's purpose: building and running an accuracy test suite for SQL generation on a data source. It enumerates the specific actions (add_test, list_tests, remove_test, run, results), making it unambiguous what the tool does and distinguishing it from siblings like run_query or smart_query which execute queries directly.

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 provides a concrete usage scenario: measuring whether keyword maps and few-shot examples improve smart_query accuracy over time. It implies when to use this tool (for evaluation) versus alternatives (direct execution), though it does not explicitly name alternatives or state when not to use it.

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