Skip to main content
Glama

SRI Ecuador — Facturación electrónica

Generar XML de factura

sri_generar_factura_xml
Read-only

Construye el XML de una factura electrónica (versión 1.1.0) con totales e IVA calculados, sin firmar ni enviar. Útil para revisar antes de emitir.

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": {
      "fechaEmision": "<fechaEmision>",
      "secuencial": "<secuencial>",
      "emisor": "<emisor>",
      "comprador": "<comprador>",
      "items": "<items>"
    },
    "name": "sri_generar_factura_xml"
  }
}

Input Schema

NameRequiredDescriptionDefault
itemsYes
pagosNo
emisorYes
propinaNo
ambienteNoAmbiente del SRI. Por defecto: el configurado en SRI_AMBIENTE o 'pruebas'.
compradorYes
secuencialYes
fechaEmisionYesaaaa-mm-dd o dd/mm/aaaa
puntoEmisionNo001
infoAdicionalNoCampos adicionales (máx. 15), p. ej. { Email: '...' }
codigoNumericoNo
establecimientoNo001

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4/5.0
Behavior4/5

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

Goes beyond the readOnlyHint=true annotation by disclosing that totals and IVA are computed automatically and that the output is unsigned and unsent, which sets expectations for a non-mutating, deterministic build step. It does not mention validation failures, whether SRI credentials/ambiente config are required, or what exactly is returned.

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?

Two tight sentences, purpose and scope front-loaded, no filler; each clause adds information (version, computed totals, no signing/sending, review use case).

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?

For a 12-parameter, deeply nested tool with no output schema, the definition covers purpose and behavior but leaves the input contract and the return value (raw XML string? parsed object? errors?) unexplained. Adequate as a summary, insufficient as guidance for correct invocation.

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?

With 12 parameters, nested objects, and only 25% schema description coverage, the description carries a heavy compensation burden but mentions none of the inputs — nothing about items, emisor/comprador, ambiente, or how totals relate to the item-level fields. The agent must infer all parameter meaning from a largely undocumented schema.

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 ('Construye el XML de una factura electrónica'), pins the document version (1.1.0), and delimits scope by saying it neither signs nor sends, which separates it from downstream siblings like sri_generar_clave_acceso or the autorización flow.

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?

'Útil para revisar antes de emitir' gives a clear context for using it (preview/draft stage), and the 'sin firmar ni enviar' clause implies the follow-up steps are handled elsewhere. It stops short of naming the alternative tool or stating a hard when-not condition.

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.