Skip to main content
Glama

consulta_sql

Query CNMC petroleum logistics data with read-only SELECT statements to retrieve installations, operators, prices, routes, capacities, and historical records.

Instructions

Ejecuta una única sentencia SELECT (o WITH … SELECT) sobre la base, en solo lectura.

Tablas principales: instalaciones, detalles, detalle_productos, operadores, operadores_nombres, precios, condiciones, servicios_incluidos, precios_origen_destino, notas_origen_destino, capacidades, documentos, filas_documento, enlaces_documento, precios_pdf, matrices_pdf, bonificaciones, notas_pdf, condiciones_pdf, cobertura_pdf, ejecuciones, incidencias. Vistas útiles: precios_pdf_por_detalle, reconsignaciones, lineas_pdf_sin_resolver. Cada tabla con historial tiene una vista _vigentes con lo visto en la última foto. La función plano(texto) quita tildes y mayúsculas. Usa estado para ver las columnas.

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": {
      "sql": "<sql>"
    },
    "name": "consulta_sql"
  }
}

Input Schema

NameRequiredDescriptionDefault
sqlYes
limiteNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations supplied, the description carries the full burden and does disclose the two most important traits: single statement and read-only enforcement, plus a table/view inventory and the plano() helper. It omits operational behavior that matters for arbitrary SQL — implicit row cap, timeouts, cost of expensive queries, and what happens on a rejected/write statement.

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?

Front-loads the binding constraint (single read-only SELECT) before the reference material, so the critical rule is read first. The long table inventory is dense but serves schema discovery in a toolset with no annotations; a few lines could still be trimmed.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Because an output schema exists, return values need not be explained, and the schema/domain inventory is unusually thorough. However, for an arbitrary-SQL tool with zero annotations, the silence on the 200-row default limit and on failure/timeout behavior leaves an agent unable to predict execution outcomes.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description must compensate. The `sql` parameter is only implied by the sentence about SELECT statements, and the `limite` parameter (default 200) is never mentioned at all, leaving its role and its interaction with the result set entirely undocumented.

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?

States a specific verb and resource: execute a single read-only SELECT (or WITH … SELECT) against the database. It is unambiguous as the raw-SQL escape hatch, but it never names a domain sibling (e.g. buscar_precios) to contrast with, so sibling differentiation is left implicit.

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 clear operating context (one statement only, read-only) and genuine discovery guidance by pointing to the `estado` tool to inspect columns, plus the `<tabla>_vigentes` view convention. It stops short of saying when to prefer a specialized sibling tool over hand-written SQL, or when a query would be rejected.

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