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.

Input Schema

TableJSON 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.1/5.0
Behavior3/5

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

Annotations declare readOnlyHint=true so safety is covered. Beyond that, the description adds meaningful context: the default interpretation of `importe`, the reverse-calculation mode, and the strict 'only applies given rates' constraint. It does not describe the output structure, but no output schema exists, so more could have been said about returned fields.

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?

Three tight sentences, front-loaded with the operation and immediately followed by the mode logic and scope limit. No filler; every sentence carries information.

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 five parameters, 100% schema coverage, and no output schema, the description is largely complete for correct invocation. The remaining gap is that it never describes what the response returns (base, VAT, IRPF amounts), which an agent needs to interpret the result.

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 already 100%, so parameter docs are mostly redundant. However, the description adds real semantic value the schema text only partially covers: that `importe` is the base by default and becomes the VAT-inclusive total when incluye_iva=true, which is a non-obvious default behavior.

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 gives a precise verb (Compute) and enumerated outputs (taxable base, VAT amount, recargo, IRPF withholding), and the title/body tie it specifically to Spanish IVA/IRPF. This distinguishes it clearly from siblings like calculate_modelo_303 (a specific tax form) and check_vat_number.

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?

It clearly states the two operation modes (base-first default vs. reverse with incluye_iva=true) and explicitly delimits the tool's scope with 'it does NOT decide which VAT or IRPF rate applies.' The negative scope is helpful, though it does not point to a sibling for rate determination.

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