Skip to main content
Glama
Sifende MCP Server
by ithdev

Calcular totales de un documento

calcular_totales
Read-only

Calculate a document's total with Sifende validation rules and official SET rounding to obtain the exact cash payment amount before issuing.

Instructions

Calcula el total de un documento con las mismas reglas que valida Sifende, incluido el redondeo oficial de la SET (en guaraníes, al múltiplo de 50 inferior). Usala para obtener el montoPago exacto de una venta al contado antes de emitir. Los precios incluyen IVA. Es un cálculo local, sin llamar a la API.

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": {
      "items": "<items>"
    },
    "name": "calcular_totales"
  }
}

Input Schema

NameRequiredDescriptionDefault
itemsYesÍtems del documento, con los mismos nombres de campo que en emitir_documento.
comisionNoComisión de la operación, con IVA 10% incluido.
tipoCambioNoTipo de cambio global; obligatorio fuera de PYG si los ítems no traen el suyo.
monedaOperacionNoCódigo de moneda de la operación. Por defecto PYG (guaraníes).PYG
descuentoGlobalPorcentajeNoPorcentaje de descuento global aplicado a cada ítem.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, and the description reinforces this with 'Es un cálculo local, sin llamar a la API', which is valuable confirmation rather than contradiction. It also discloses the non-obvious rounding behavior (lower multiple of 50) and that prices include IVA. It does not describe the shape of the returned totals beyond mentioning montoPago.

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?

Four short sentences, front-loaded with the verb and resource, then rounding rule, use case, and locality. Every sentence carries actionable information with no filler.

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?

For a local computation tool with no output schema and fully documented parameters, the description covers rules, locality, and the key use case. It could be slightly stronger by stating what the returned totals contain (beyond montoPago), but an agent has enough to invoke it correctly.

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?

Schema description coverage is 100%, so every parameter is already documented in the schema; the description adds no per-parameter syntax or constraints. The note that prices include IVA and that field names match emitir_documento is helpful but closely mirrors what the schema already states.

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 ('Calcula el total de un documento') and scopes it to Sifende validation rules and the official SET rounding in guaraníes. An agent can distinguish it from the sibling read/query tools (consultar_documento, listar_eventos) because it produces a computed total rather than retrieving stored data.

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?

Explicitly says to use it 'para obtener el montoPago exacto de una venta al contado antes de emitir', giving a concrete triggering condition and workflow position. It does not state when NOT to use it (e.g. for crédito or for already-issued documents), so it falls short of full exclusion guidance.

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