Skip to main content
Glama
NLQueries

NLQueries

Official
by nlqueries

submit_feedback

Record thumbs-up or thumbs-down feedback on a natural-language-to-SQL query result, with optional corrected SQL, to support verified examples and knowledge-base updates.

Instructions

Record user feedback for a query result.

Feedback is stored in ~/.nlqueries/feedback/<agent_id>.jsonl. A thumbs-up
can become a verified example through ``nlqueries promote-feedback``, and a
correction an example query through ``nlqueries export-kb``; feedback sent
here is used only when an operator includes it with ``--include-anonymous``.

Args:
    question:      The question that was asked.
    agent_id:      The agent that answered it.
    generated_sql: The SQL that was generated (copy from the query result).
    rating:        ``"up"`` (correct answer) or ``"down"`` (wrong answer).
    corrected_sql: Optional corrected SQL when rating is ``"down"``.

Returns:
    Confirmation string, or an error message.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "question": "<question>",
      "agent_id": "<agent_id>",
      "generated_sql": "<generated_sql>",
      "rating": "<rating>"
    },
    "name": "submit_feedback"
  }
}

Input Schema

NameRequiredDescriptionDefault
ratingYes
agent_idYes
questionYes
corrected_sqlNo
generated_sqlYes

Output Schema

NameRequiredDescriptionDefault
resultYes

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?

With no annotations, the description carries the full burden and does well: it discloses the storage path, the downstream promotion workflow, and the gating condition for use. It is less clear on duplicate handling, permissions, or idempotency, but covers the important behavioral context.

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 description is front-loaded with the core action and structured as a docstring with Args and Returns. Most sentences earn their place, though the workflow explanation is slightly dense.

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?

Given five parameters, no annotations, and an output schema, the description is nearly complete: it explains parameter meanings, storage, promotion, and return behavior. It could mention authorization or whether agent_id must match the caller, but the essential information is present.

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%, so the description must compensate, and it does: it documents all five parameters, including the critical rating semantics ('up' or 'down') and when corrected_sql applies. This adds substantial meaning beyond the bare schema titles.

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 first sentence states a specific verb and resource: 'Record user feedback for a query result.' It clearly distinguishes this tool from all listed siblings, none of which handle feedback.

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 explains downstream usage paths (promote-feedback and export-kb) and notes that feedback is only used with --include-anonymous. It provides clear context but does not explicitly state when to use this tool versus any alternative, which is reasonable since there is no sibling feedback tool.

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