Skip to main content
Glama

Calculate VAT (IVA) and IRPF withholding

calculate_vat
Read-only

Compute the taxable base, VAT (IVA) amount, optional recargo de equivalencia and optional IRPF withholding from an amount. By default importe is the taxable base (sin IVA). With incluye_iva=true, importe is the TOTAL with VAT already included and the base is derived backwards (quitar IVA / reverse VAT). It only applies the rates it is given: it does NOT decide which VAT or IRPF rate applies to a case. Returns base_imponible, cuota_iva, recargo_importe, retencion_irpf, total_con_iva and total_factura (total after subtracting the IRPF withholding).

Input Schema

NameRequiredDescriptionDefault
irpfNoIRPF withholding rate in %, e.g. 15, 19. Default 0
importeYesAmount: taxable base, or total with VAT if incluye_iva=true
recargoNoRecargo de equivalencia rate in %, e.g. 5.2, 1.4, 0.5, 1.75. Default 0
tipo_ivaYesVAT rate in %, e.g. 21, 10, 4, 0
incluye_ivaNoTrue if `importe` already includes VAT (reverse calculation)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.3/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 adds useful behavioral context: reverse VAT calculation, rate-application boundary, and the returned total_factura after IRPF withholding. It does not discuss rounding or error behavior, so not a 5.

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?

Front-loaded with the purpose, then proceeds through default behavior, reverse calculation, rate boundary, and return values. Every sentence earns its place with no repetition or filler.

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?

Although there is no output schema, the description lists all returned fields and explains total_factura versus total_con_iva. Combined with the read-only annotations and complete parameter schema, it gives the agent everything needed to call the tool 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 parameter meanings are already fully documented. The description restates the importe/incluye_iva relationship and adds return-field context, but adds little parameter semantics beyond the schema itself, making the baseline 3 appropriate.

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 (compute) and the exact resources it calculates: taxable base, VAT, recargo de equivalencia, and IRPF withholding. The boundary that it only applies supplied rates and does not decide which rate applies distinguishes it from rate-decision or tax-form tools.

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?

Clearly explains the default mode (importe as taxable base) and the reverse-VAT mode when incluye_iva=true. It also states a key exclusion (it does not decide applicable rates), though it does not explicitly name a sibling alternative such as calculate_modelo_303.

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.

Resources