Skip to main content
Glama

Ask the database a question

ask

Answer plain-language database questions and return the result, executed SQL, rows, and a latency/cost trace, showing whether a query actually ran.

Instructions

Answer a question about the database in plain language. Returns the answer, the SQL that was actually executed, the rows it returned, and a trace of every step with its latency and cost. sql_was_executed is false when the agent answered without running a query; in that case final_sql is null and claimed_sql holds whatever SQL the model typed into its answer without running it.

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>"
    },
    "name": "ask"
  }
}

Input Schema

NameRequiredDescriptionDefault
questionYes

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.9/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 real work: it discloses that the agent may answer without executing SQL, that sql_was_executed goes false, that final_sql is null in that case, and that claimed_sql may contain unexecuted SQL the model wrote. That is a genuinely non-obvious failure mode an agent needs. It is silent, however, on whether the generated SQL can write or only read, and on permissions, cost, and latency of the tool itself.

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?

Front-loaded with the purpose, then the return shape, then the one edge case that changes interpretation. Two sentences, no filler, and the caveat is placed where it will be read.

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?

An output schema exists, so the enumerated return fields are partly redundant, but the sql_was_executed/claimed_sql distinction is interpretive rather than schema-restating. What is missing for a tool that runs generated SQL is whether that SQL is read-only and what happens on query failure or timeout.

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 0%, but there is only one parameter, "question", and the description adds the meaningful constraint that it should be phrased in plain language rather than SQL. That is close to everything an agent needs for this input.

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?

"Answer a question about the database in plain language" gives a specific verb and resource and signals the NL-to-SQL nature that separates it from run_sql. It stops short of naming run_sql or describe_table as the alternative, so the boundary is inferred from the "plain language" phrasing rather than stated.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is only implied: ask a natural-language question when you want an answer rather than raw SQL. There is no explicit "use this instead of run_sql when..." routing, and no stated preconditions such as needing table names discovered via list_tables first.

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

Deploy Server

Other Tools