Skip to main content
Glama
ssolis-ti

Compra Ágil MCP Server

Generar informe imprimible

generar_informe

Generate printable HTML reports from Compra Ágil data—opportunity radar, quotes, price/audit/competition analysis—and return the saved file path for PDF export.

Instructions

Genera un informe profesional imprimible (HTML con diseño de impresión) a partir de los datos de Compra Ágil. El archivo se guarda en disco y la herramienta devuelve la RUTA del archivo (no su contenido, para no saturar el contexto). El usuario puede abrirlo en su navegador y exportarlo a PDF con Ctrl+P (el diseño está optimizado para impresión: saltos de página controlados y cabeceras de tabla repetidas). Formatos de papel: "carta" (216×279mm, estándar de oficina en Chile, por defecto), "oficio" (216×330mm, folio chileno para documentos oficiales) y "a4" (210×297mm, estándar ISO). Tipos disponibles:

  • "radar": Radar de oportunidades activas priorizadas por facilidad de adjudicación (KPIs, gráfico de puntuación, fichas destacadas y listado completo).

  • "cotizacion": Borrador presentable de una cotización (ítems, neto, IVA 19 %, total y carta). Requiere codigo_compra. No se envía a Mercado Público.

  • "precio": Distribución de precios cotizados, no adjudicados, con gráfico. Requiere codigo_compra o q.

  • "auditoria": Brechas de presupuesto y plazo de un proceso desierto, con las recomendaciones de auditar_compras_desiertas. Requiere codigo_compra o q.

  • "competencia": Tabla de cotizantes y la brecha entre el menor y el mayor monto neto. Requiere codigo_compra. No identifica un adjudicado.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
qNoTérmino de búsqueda para acotar a un rubro o producto (ej: "licencias"). Lo usan "radar", "precio" y "auditoria".
tipoYesTipo de informe: "radar", "cotizacion", "precio", "auditoria" o "competencia".
regionNoCódigo de región para acotar (1-16). Ej: "13" para Metropolitana. Lo usan "radar" y "precio".
max_paginasNoSolo "radar". Cuántas páginas de 10 resultados escanear (1-10, default 3). Cada página es una consulta de unos 8 s. Una página de 50 del mismo filtro responde HTTP 504.
ruta_salidaNoSubcarpeta dentro de la carpeta de informes (ej: "radar/octubre"). Si se omite, se usa la carpeta de informes: "informes/" de la carpeta de datos del servidor, o la que fije COMPRA_AGIL_INFORMES_DIR. No acepta carpetas fuera de ella.
razon_socialNoSolo "cotizacion". Razón social. Si se omite, el borrador marca un placeholder.
codigo_compraNoCódigo de la Compra Ágil. Obligatorio en "cotizacion" y "competencia". En "precio" y "auditoria" arma la búsqueda si no viene "q".
formato_papelNoTamaño de papel: "carta" (216×279mm, el más usado en oficinas chilenas, por defecto), "oficio" (216×330mm, folio chileno para documentos oficiales/legales) o "a4" (210×297mm, estándar ISO).carta
rut_proveedorNoSolo "cotizacion". RUT del proveedor. Si se omite, el borrador marca un placeholder.
limite_analisisNoProcesos históricos a revisar. En "precio", 1-15 (default 5). En "auditoria", 1-8 (default 3).
limite_resultadosNoSolo "radar". Cantidad máxima de oportunidades a incluir en el informe (1-50, default 20).
plazo_entrega_diasNoSolo "cotizacion". Plazo de entrega en días. Si se omite, se usa el del comprador o 5.
presupuesto_minimoNoSolo "radar". Filtrar procesos con presupuesto disponible mayor o igual a este monto en CLP.
descripcion_propuestaNoSolo "cotizacion". Mensaje comercial que entra en la carta.
palabras_clave_excluidasNoPalabras separadas por coma que NO deben estar en el nombre de los comparables (ej: "termico,panaderia"). Mismo funcionamiento que las requeridas.
palabras_clave_requeridasNoPalabras separadas por coma que DEBEN estar en el nombre de cada proceso comparable (ej: "nitrilo"). Se aplican sobre el listado antes de pedir los detalles: no gastan cuota extra y evitan mezclar productos distintos.
precio_unitario_personalizadoNoSolo "cotizacion". Precio unitario neto. Si se omite, se estima con el mismo criterio del borrador JSON.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv2.7.0

TDQS

A4.4/5.0
Behavior4/5

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

Adds real behavioral context beyond the annotations: the file is written to disk, the return value is the PATH not the content (explicitly to avoid context bloat), and the output is print-optimized with controlled page breaks and repeated table headers. This explains the readOnlyHint=false write and complements openWorldHint=true. It stops short of noting permissions, overwrite behavior of ruta_salida, or concurrent-write characteristics.

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 and the crucial return-value caveat, then uses a clean bullet list for the five types. Length is justified by 17 params and 5 modes, though the paper-format sentence largely restates the enum descriptions already in the schema.

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?

No output schema exists, and the description fully covers the contract: what is produced (an HTML file path), where it lands, and how to consume it. Combined with type-specific requirements, nothing essential for 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 adds cross-parameter conditional requirements the schema cannot express (which types require codigo_compra vs. codigo_compra-or-q, that q/region apply to specific types). This meaningfully helps the agent pick valid combinations for a 17-param tool.

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+resource (generates a printable HTML report from Compra Ágil data) and enumerates the five report types, each with its own scope. An agent can immediately tell this is a report-generation/file-output tool rather than a search or analysis tool.

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?

For each type it states the condition ("radar" = prioritized active opportunities; "cotizacion" requires codigo_compra, not sent to Mercado Público; "auditoria" requires codigo_compra or q, etc.), which gives clear selection guidance. It never names the near-duplicate siblings (generar_borrador_cotizacion, radar_oportunidades_calientes), so the agent gets no explicit when-not/to-use-which-alternative routing.

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