Skip to main content
Glama

Validar consulta SQL

validar_sql

Ejecuta una consulta SQL (dialecto Postgres, motor pg-mem en memoria) contra tablas de prueba opcionales y devuelve las filas reales resultantes. Usa un motor SQL real, no una suposición del modelo sobre qué devolvería la query. Sin base de datos persistente: las tablas se crean desde cero en cada llamada y se descartan al terminar. Cuesta $0.04 USDC (Base) por llamada.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesLa consulta SQL a ejecutar (ej: "SELECT nombre FROM clientes WHERE activo = true"). Máximo 5000 caracteres.
tablesNoTablas de prueba a crear antes de correr la query. Omitir si la query no referencia ninguna tabla. Máximo 5 tablas.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
rowsYesFilas resultantes de la ejecución real de la query, hasta un máximo de 500.
errorYesMensaje de error si valid_query es false; null si es válida.
truncatedYestrue si el resultado real tenía más de 500 filas y se cortó.
valid_queryYesfalse si la query tiene un error de sintaxis o de ejecución (ej: tabla inexistente).

TDQS

A4.5/5.0
Behavior5/5

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

With no annotations provided, the description provides rich behavioral context: it uses pg-mem (in-memory) with Postgres dialect, tables are created and discarded each call (no persistence), costs $0.04 per call, and returns actual rows. This goes beyond basic function and reveals key operational traits, enabling the agent to anticipate side effects and costs.

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 three concise sentences, each earning its place: function, value proposition (real engine), and behavior (ephemeral tables, cost). It is front-loaded with the core purpose and avoids redundancy. Ideal length for the tool's complexity.

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 the tool's moderate complexity, the description covers all key aspects: execution mechanics, engine/dialect, test tables, return value, persistence, and cost. It also benefits from a full output schema (context signal) and complete parameter descriptions in the schema, so the description is sufficient for effective use.

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 documents both query and tables. The tool description adds minimal semantic value beyond the schema, merely mentioning 'tablas de prueba opcionales' without additional detail. Per the baseline rule for high coverage, this scores a 3.

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 function: 'Ejecuta una consulta SQL (dialecto Postgres, motor pg-mem en memoria) contra tablas de prueba opcionales y devuelve las filas reales resultantes.' It specifies the verb (ejecuta), resource (consulta SQL), and distinct scope (test tables, returns rows). The distinction from siblings ('validar_cron', 'validar_regex') is implicit through the focus on SQL execution, making the purpose unambiguous.

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 implies when to use the tool: 'Usa un motor SQL real, no una suposición del modelo sobre qué devolvería la query.' This signals that the tool is for situations requiring actual SQL execution rather than model inference. It also notes optional test tables and cost, providing practical context. However, it does not explicitly name alternatives or exclusions, so it falls short of a perfect score.

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.

TDQS

A4.4/5.0
Disambiguation5/5

Each tool targets a completely different domain: cron expressions, regular expressions, and SQL queries. There is no overlap or ambiguity between them.

Naming Consistency5/5

All tool names follow the same 'validar_' prefix followed by the target domain (cron, regex, sql). This creates a clear and predictable pattern.

Tool Count5/5

With exactly three tools for three distinct validation areas, the count is well-scoped and each tool justifies its existence.

Completeness5/5

The server fully covers the stated purpose of validating cron, regex, and SQL. Each tool provides meaningful execution and results, leaving no obvious gaps.