Skip to main content
Glama

Consulta SQL libre

consulta_sql
Read-onlyIdempotent

Run a single read-only SQL SELECT query against local Chilean tax data copies (RCV, F29, F22, and others) to filter, aggregate, or inspect records by RUT and period.

Instructions

Ejecuta una sola sentencia SELECT (o WITH … SELECT) de solo lectura sobre una copia de los datos locales (RCV, F29, propuesta de F29, boletas de honorarios recibidas, renta F22, hallazgos y bitácora de sincronización). Llama antes una vez a datos_esquema: describe tablas, columnas y reglas (signo de las notas de crédito, estados del RCV, códigos del F29). Sin parámetros: escribe los valores como literales. Devuelve como máximo 200 filas y 40000 caracteres: filtra por RUT y período, agrupa o usa LIMIT.

Input Schema

NameRequiredDescriptionDefault
sqlYesUna sola sentencia SELECT o WITH … SELECT

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

Beyond the annotations, it discloses the hard output caps (200 filas, 40000 caracteres), the single-statement restriction, that the query runs against a copy of local data rather than production, and the literal-only constraint. These are exactly the operational facts an agent must know to avoid failing or over-scanning.

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?

Three dense sentences: what it runs, the prerequisite tool, then the limits and tuning advice. No repetition of the title or the schema, and the most important constraint (solo lectura, una sola sentencia) is front-loaded.

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?

With no output schema, the description compensates by stating the row/character caps and pointing to datos_esquema for table and column semantics. Minor gaps remain: it doesn't name the SQL dialect or note error behavior for an invalid statement.

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 100% and documents the sql string itself, but the description adds a real constraint not in the schema: no bind parameters — values must be written as literals. That is meaningful extra semantics for the only parameter.

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?

States a specific verb (ejecuta), a precise resource (una sola sentencia SELECT/WITH … SELECT de solo lectura) and enumerates the datasets it can reach (RCV, F29, boletas, F22, hallazgos, bitácora). It is clearly distinguishable from siblings like rcv_documentos or f29_historial, which are fixed-shape readers rather than free queries.

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?

Gives an explicit prerequisite ("Llama antes una vez a datos_esquema") and guidance on how to keep queries cheap (filter by RUT and período, agrupa o usa LIMIT). It does not say when to prefer a sibling tool over free SQL, so no full when/when-not routing is present.

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