Skip to main content
Glama
ferflorwers25

Auto Parts Inventory Agent

consulta_sql

Read-onlyIdempotent

Run read-only SELECT queries for rankings, monthly totals, or branch comparisons not covered by other tools; returns up to 500 rows.

Instructions

Ejecuta una consulta SELECT de solo lectura. Es el respaldo para preguntas que las otras herramientas no cubren (rankings, totales por mes, comparaciones entre sucursales, etc.).

Límites: una sola sentencia, solo lectura, máximo 500 filas y 5 segundos.

Esquema (PostgreSQL, montos en córdobas):
- categorias(id, nombre, descripcion)
- proveedores(id, nombre, pais, contacto, telefono, email)
- repuestos(id, codigo, nombre, marca, categoria_id, proveedor_id, precio_nio, costo_nio, activo)
- modelos_vehiculo(id, marca, modelo, anio_desde, anio_hasta, tipo: 'vehiculo'|'maquinaria'|'motocicleta')
- repuesto_modelo(repuesto_id, modelo_id)  -- compatibilidad muchos a muchos
- sucursales(id, nombre, ciudad, departamento, direccion, telefono)
- inventario(sucursal_id, repuesto_id, stock_actual, stock_minimo)
- movimientos(id, repuesto_id, sucursal_id, tipo: 'entrada'|'salida',
              motivo: 'inventario_inicial'|'compra'|'venta'|'ajuste',
              cantidad (siempre positiva), precio_unitario, fecha timestamptz, referencia)
  precio_unitario es el precio de venta en ventas y el costo en entradas y ajustes.
- v_stock_bajo_minimo(sucursal, codigo, repuesto, marca, categoria, stock_actual, stock_minimo, faltante)
Para ignorar tildes usá unaccent(), ej.: unaccent(nombre) ILIKE unaccent('%estelí%').
Movimientos: 2026-04-01 a 2026-09-30, zona horaria America/Managua.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYesUna sola consulta SELECT (o WITH ... SELECT) de PostgreSQL.
limiteNoMáximo de filas a devolver (1 a 500).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare readOnlyHint/idempotentHint, and the description goes well beyond by disclosing concrete operational limits: single statement, read-only, max 500 rows, 5-second timeout, and the timezone/date window for movimientos. These constraints are essential for an agent to avoid failing calls.

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 purpose, then limits, then schema, then edge-case notes — a clean order. The schema block is lengthy, but every line is functionally necessary for writing valid SQL, so it earns its size even if it reads as a data dump.

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?

With an output schema present the description needn't explain return values, and it covers everything else an agent needs: limits, the full domain model, date range, timezone and accent handling. Nothing necessary for a correct invocation is missing.

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%, so baseline is 3, but the description materially enriches the 'sql' parameter by supplying the full PostgreSQL schema, join relationships, enum values for tipo/motivo, the unaccent() idiom, and the semantics of precio_unitario per movement type. That is real added meaning beyond 'una sola consulta SELECT'.

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 and resource ('Ejecuta una consulta SELECT de solo lectura') and immediately positions itself against siblings as the fallback ('el respaldo para preguntas que las otras herramientas no cubren'). An agent can distinguish it from buscar_repuestos, stock_bajo_minimo and resumen_movimientos without opening any schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly names when to reach for this tool (rankings, monthly totals, cross-branch comparisons not covered by other tools), implying the alternatives and the conditions that select them. Nothing about routing is left to inference.

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