Skip to main content
Glama

Peru Invoices (CPE factura/boleta electrónica, SUNAT)

Server Details

Peru CPE invoices for AI agents - issue, query, void facturas/boletas via SUNAT (2 backends).

Status
Healthy
Last Tested
Transport
Streamable HTTP
URL

Glama MCP Gateway

Connect through Glama MCP Gateway for full control over tool access and complete visibility into every call.

MCP client
Glama
MCP server

Full call logging

Every tool call is logged with complete inputs and outputs, so you can debug issues and audit what your agents are doing.

Tool access control

Enable or disable individual tools per connector, so you decide what your agents can and cannot do.

Managed credentials

Glama handles OAuth flows, token storage, and automatic rotation, so credentials never expire on your clients.

Usage analytics

See which tools your agents call, how often, and when, so you can understand usage patterns and catch anomalies.

100% free. Your data is private.
Tool DescriptionsA

Average 4.5/5 across 3 of 3 tools scored.

Server CoherenceA
Disambiguation5/5

Each tool targets a distinct action (create, cancel, query) on the same resource (invoice). No overlap in purpose.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern with underscores: create_invoice, cancel_invoice, query_invoice.

Tool Count5/5

Three tools cover the essential lifecycle of invoices (create, cancel, query) without redundancy.

Completeness3/5

The core operations are present, but credit notes (nota de crédito) are mentioned as missing, which is a notable gap in the invoice correction workflow.

Available Tools

3 tools
cancel_invoiceA
DestructiveIdempotent
Inspect

Void a Peru CPE at SUNAT (generar_anulacion — a comunicación de baja). Identified by comprobante_type + serie + numero, plus a free-text motivo (reason, e.g. "ERROR DEL SISTEMA"). SUNAT processes voids asynchronously via a ticket, so status is usually PENDING right after — call query_invoice later to confirm the document shows anulado=true. Note: for value corrections you normally issue a nota de crédito instead of a full void (notas not yet exposed by this server).

ParametersJSON Schema
NameRequiredDescriptionDefault
serieYesThe series (e.g. F001 / B001).
motivoNoReason for the void (motivo), 3 to 100 chars, e.g. "ERROR DEL SISTEMA". Default "ERROR DEL SISTEMA".
numeroYesThe correlative number to void.
providerNoOptional. Backend to void through; omit to auto-detect from your credential header.
comprobante_typeYesThe document type to void.
Behavior5/5

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

The description discloses important behavioral traits beyond the annotations: asynchronous processing via ticket, initial PENDING status, and the need to query later. It also notes that for corrections, a nota de crédito is preferred. No contradiction with annotations.

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?

The description is a single, well-structured paragraph that front-loads the purpose and clearly presents the key information without unnecessary words. Every sentence adds value.

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?

The description covers the tool's purpose, key parameters, async behavior, and alternative actions. However, it lacks mention of error conditions, timeouts, or specific credential requirements. For a tool with no output schema, it adequately describes expected outcomes.

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

Parameters3/5

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

The schema has 100% description coverage, so the parameter semantics are already clear. The description reinforces the key identification triplet (comprobante_type + serie + numero) and gives an example for motivo, but does not add critical new meaning beyond the schema.

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?

The description clearly states the action ('Void a Peru CPE at SUNAT') and the resource, but does not explicitly distinguish this tool from sibling tools (create_invoice and query_invoice). It does mention an alternative (nota de crédito) but not sibling differentiation.

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?

The description provides explicit guidance on when to use (void) and when not to (use nota de crédito for corrections). It also advises to call query_invoice later to confirm the void status. However, it does not fully exclude alternatives like using create_invoice for a new document.

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

create_invoiceAInspect

Issue a Peru electronic CPE (comprobante de pago electrónico) — FACTURA (B2B, buyer RUC) or BOLETA (B2C consumer) — declared to SUNAT. Two backends (auto-selected from your credential header, or force with "provider"): NUBEFACT (headers x-nubefact-ruta = your unique full RUTA URL e.g. https://api.nubefact.com/api/v1/, AND x-nubefact-token = your account TOKEN; free DEMO at www.nubefact.com) or APISUNAT (PSE cloud; headers x-apisunat-persona-id + x-apisunat-persona-token + x-apisunat-ruc = your 11-digit issuer RUC; free self-signup at apisunat.com with a DEV persona for testing). Both keep your SUNAT credentials in your own provider account; this server forwards them per-request and stores nothing. The same credentials switch to production at the account level, so this server reports mode "nubefact-account"/"apisunat-account" honestly rather than guessing demo vs production. ⚠️ NUMBERING IS MERCHANT-MANAGED: this server is stateless and does NOT track sequences — YOU must supply "serie" (e.g. F001 for facturas, B001 for boletas) and the next sequential "numero" yourself; reusing a numero is rejected by SUNAT, skipping one leaves a gap. Give item prices WITH IGV included (precio_unitario) — this server computes valor_unitario, subtotal, IGV (18%) and totals for you.

ParametersJSON Schema
NameRequiredDescriptionDefault
itemsYesLine items. Each price is the UNIT price INCLUDING IGV in PEN (soles); this server derives the untaxed value, IGV and totals.
serieYesDocument series, exactly 4 chars. FACTURA starts with F (e.g. F001); BOLETA starts with B (e.g. B001). Merchant-defined; must exist in your Nubefact account.
numeroYesSequential correlative number YOU manage (this server is stateless and does not track it). No leading zeros; 1 to 8 digits. Reusing a numero is rejected by SUNAT.
providerNoOptional. Which backend OSE/PSE to issue through. Omit to auto-detect from your credential header (x-nubefact-ruta -> nubefact; x-apisunat-persona-id -> apisunat; default nubefact).
igv_percentNoIGV rate percent. Default 18 (Peru standard). Only change if you know the item is under a special rate.
customer_nameYesBuyer legal name / full name (razón social o nombre completo).
customer_emailNoOptional buyer email — Nubefact emails the CPE to the buyer when provided.
comprobante_typeYesfactura = B2B invoice (buyer must have an 11-digit RUC); boleta = B2C consumer receipt (buyer DNI or none). Determines the tipo_de_comprobante and the required serie prefix (F.../B...).
customer_addressNoBuyer address (dirección). Recommended for factura; optional for boleta.
fecha_de_emisionNoOptional emission date DD-MM-AAAA. Defaults to today (America/Lima). SUNAT expects the current date.
sunat_transactionNoSUNAT transaction type (sunat_transaction). Default 1 (VENTA INTERNA). Other codes are for special operations (exportación, detracción, etc.).
customer_document_typeNoBuyer document type. RUC (11 digits) is REQUIRED for factura. DNI (8 digits) is typical for boleta. Defaults: factura->RUC, boleta->DNI.
customer_document_numberYesBuyer RUC (11 digits) or DNI (8 digits). For a factura this must be a valid 11-digit RUC.
Behavior5/5

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

The description fully discloses that the server is stateless and does not track sequences, that it forwards credentials per-request and stores nothing, and that it does not guess demo vs production but reports mode honestly. Annotations already provide readOnlyHint, destructiveHint, and idempotentHint, and the description adds significant behavioral context without contradiction.

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?

The description is lengthy but every sentence adds necessary detail for a complex tool. It is front-loaded with the core purpose and then provides critical usage warnings. Minor redundancy (e.g., repeating numbering details) could be trimmed, but overall it is well-structured and earns its length.

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?

Given the high complexity (13 parameters, 6 required, two backends, SUNAT compliance, statelessness), the description covers almost all aspects: credential setup, numbering, pricing, date defaults, document types, transaction types, and backend modes. The only minor gap is the lack of mention of the response format or return values since there is no output schema, but this does not significantly detract.

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?

With 100% schema coverage, baseline is 3. The description substantially adds meaning beyond the schema: it explains the numbering format (serie 4 chars, F/B prefix; numero 1-8 digits, no leading zeros), the pricing inclusion logic (precio_unitario includes IGV), and the implications of comprobante_type on customer document type and serie prefix. It also clarifies the provider auto-detection and optional defaults.

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?

The description clearly and specifically states the tool issues a Peru electronic CPE (factura/boleta) and declares to SUNAT, distinguishing it from the sibling tools cancel_invoice and query_invoice which handle cancellation and querying respectively.

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?

The description provides explicit guidance on when to use each backend (NUBEFACT vs APISUNAT) via headers or force with 'provider', warns about merchant-managed numbering, explains the implication of comprobante_type for document type and serie prefix, and indicates the conditions for factura (B2B, requires RUC) vs boleta (B2C).

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

query_invoiceA
Read-only
Inspect

Check a Peru CPE previously issued (consultar_comprobante) by its identity: comprobante_type + serie + numero (Nubefact/SUNAT identify documents by these, not by an opaque id). Status values: ACCEPTED (aceptada_por_sunat=true), PENDING (not yet sent/processing), REJECTED (SUNAT returned an error — see sunat_description). Also returns anulado (true if voided) and the PDF/XML/CDR links. Safe to call anytime.

ParametersJSON Schema
NameRequiredDescriptionDefault
serieYesThe series (e.g. F001 / B001).
numeroYesThe correlative number.
providerNoOptional. Backend to query; omit to auto-detect from your credential header.
comprobante_typeYesThe document type used when it was created.
Behavior5/5

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

Annotations already declare readOnlyHint=true; description adds specifics about status values, anulado, and CDR/PDF/XML links, providing full behavioral context beyond annotations.

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 sentences with clear structure: first sentence states purpose and identity, second enumerates return values. No filler, every sentence adds value.

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, but description sufficiently explains return fields (status values, anulado, links) and safety, making it complete for a read-only query tool.

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% with good descriptions; description adds real-world identity concept and explains how parameters relate to SUNAT identification, adding meaningful context.

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 explicitly it checks a Peru CPE by identity, listing required fields and purpose, clearly distinguishing from cancel_invoice and create_invoice.

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?

Provides clear context: it's a query by specific identity fields and is 'safe to call anytime'. Doesn't state exclusions but context implies it's always appropriate.

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

Discussions

No comments yet. Be the first to start the discussion!

Try in Browser

Your Connectors

Sign in to create a connector for this server.

Resources