Skip to main content
Glama

ai_sql

Read-only

AI text-to-SQL — Turn a plain-English question into one SQL query, optionally constrained to your schema and dialect, with statement type and read-only flag. Pass ?question=, optional ?schema= and ?dialect= (default postgresql). Price: $0.01 USDC (Base, via x402).

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": "ai_sql"
  }
}

Input Schema

NameRequiredDescriptionDefault
schemaNooptional CREATE TABLE text or column list
dialectNooptional, default postgresql
questionYeswhat you want to query

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, and openWorldHint=true, so the safety profile is clear. The description adds valuable behavioral context beyond annotations: it states the tool returns one SQL query with statement type and a read-only flag, specifies the default dialect (postgresql), and discloses pricing ($0.01 USDC via x402). These details help an agent understand cost and output characteristics, though it doesn't cover error handling or limitations on complex queries.

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 purpose ('AI text-to-SQL — Turn a plain-English question into one SQL query') and efficiently packs optional constraints, output details, parameter passing, and pricing into a single sentence plus a short note. No unnecessary words, though the mid-sentence clause about statement type and read-only flag could be slightly clearer.

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 the tool's relative simplicity (3 parameters, no output schema, annotations present), the description is largely complete: it explains the purpose, default dialect, output characteristics, and pricing. It omits specifics like supported SQL statement types or edge-case behavior, but an agent has enough to invoke it correctly.

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 input schema already fully documents all three parameters (question, schema, dialect). The description reiterates how to pass them and repeats the default dialect value, adding little meaning beyond the schema. The baseline of 3 is appropriate when the schema does the heavy lifting.

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 states a specific verb and resource: 'Turn a plain-English question into one SQL query'. It distinguishes itself from siblings like ai_chat or ai_extract by focusing on SQL generation, and it mentions optional schema and dialect constraints. An agent can immediately tell this is a text-to-SQL converter, not a general chat or extraction tool.

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 clear context for when to use it: when you have a plain-English question and want a SQL query, optionally constrained to your schema and dialect. It does not explicitly name alternatives or state when not to use it, but the specific context is strong enough for an agent to infer appropriate use.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources