Skip to main content
Glama

submit_query_feedback

Rate the accuracy of generated SQL and supply corrected SQL when incorrect. This feedback trains the smart_query model to reduce future errors.

Instructions

Record whether the SQL produced for a question was correct, so smart_query improves over time. Behavior: stores an up/down rating; when you rate 'down' and supply the correct SQL, the error is classified and, if the same kind of mistake recurs, automatically promoted into a few-shot example. Returns the feedback id and any error type or promotion. Usage: call after reviewing smart_query/run_query output; feedback is stored locally per data_source_id and feeds the learning loop.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ratingYesRating: up (correct) or down (incorrect)
questionYesOriginal natural-language question
correct_sqlNoCorrect SQL (provide when rating=down for automatic learning)
generated_sqlYesGenerated SQL
data_source_idYesData source ID
Behavior5/5

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

With no annotations, the description fully discloses behavior: it stores ratings, classifies errors on 'down' ratings, and promotes recurring mistakes into few-shot examples. It also mentions the return values (feedback id, error type, promotion). No contradictions.

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 with no wasted words. It opens with a clear purpose sentence, then details behavior, and ends with usage context. Every sentence earns its place.

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

Completeness5/5

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

Given no output schema, the description covers return values (feedback id, error type, promotion). It explains the feedback loop and storage location. For a tool with 5 parameters and moderate complexity, this is complete and actionable.

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%, baseline is 3. The description adds value by explaining the conditional nature of 'correct_sql' (provide when rating=down) and how 'rating' enum values map to up/down. This goes beyond the schema's literal descriptions.

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 with a specific verb ('Record'/'store') and resource ('correctness of SQL'). It explicitly distinguishes from sibling tools like 'run_query' and 'smart_query' by focusing on feedback collection for improvement.

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 explicit guidance: 'call after reviewing smart_query/run_query output' and explains that feedback feeds the learning loop. It implies when to use but does not explicitly list when not to use or mention alternatives.

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/seob717/redash-mcp'

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