Skip to main content
Glama

generate_query

Turn natural-language prompts into one read-only SQL query, enabling safe data retrieval from PostgreSQL.

Instructions

Turn a natural-language request into one read-only SQL statement.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
promptYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior3/5

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

With no annotations, the description carries the burden of behavioral disclosure. It discloses that the tool produces one read-only SQL statement and does not claim to execute it, which are useful behavioral traits. However, it does not elaborate on potential constraints, validation behavior, or how it relates to execution beyond that implication.

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 a single, front-loaded sentence with no wasted words. Every phrase adds value: 'natural-language request' defines the input, 'read-only' signals safety, and 'SQL statement' defines the output.

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 single-parameter generation tool with an output schema, the description is nearly complete: it defines the input, the output, and the read-only nature. It would be more complete with an explicit note about not executing the generated SQL and when to choose this over the sibling execution tools.

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?

The schema has zero description coverage, so the description must clarify the parameter. It does this by identifying the input as a 'natural-language request,' which adds meaning to the bare 'prompt' property. It also defines what the output will be, helping the agent understand the transformation.

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?

The description states a specific action ('turn ... into') and resource/outcome: a natural-language request becomes one read-only SQL statement. It clearly distinguishes generation from the sibling execution tools by describing the output as a statement rather than a run operation, though it does not explicitly name an alternative.

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?

The description implies the tool is used when a natural-language request needs to be converted into SQL, and the read-only qualifier signals a safe generation context. It does not explicitly say when to use this tool instead of run_readonly_query, execute_generated_query, or the table-introspection siblings.

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

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/eastonjeff/mcp-server'

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