Skip to main content
Glama

calcular_intereses

Calculate Spanish tax late-payment interest or legal interest across a date range using official annual rates, with optional exclusion of periods without accrual.

Instructions

Intereses de demora tributarios (art. 26 LGT) o interés legal del dinero, por tramos con los tipos oficiales de cada año (tabla de la AEAT).

Args: importe: principal (cuota). desde: día de vencimiento del plazo (los intereses corren desde el día siguiente), AAAA-MM-DD. hasta: último día de devengo (pago o liquidación), AAAA-MM-DD. excluir: periodos sin devengo [[desde, hasta], …] (arts. 26.4 y 150.6.c LGT). tipo_interes: «demora» o «legal».

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": {
      "importe": "<importe>",
      "desde": "<desde>",
      "hasta": "<hasta>"
    },
    "name": "calcular_intereses"
  }
}

Input Schema

NameRequiredDescriptionDefault
desdeYes
hastaYes
excluirNo
importeYes
tipo_interesNodemora

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A4/5.0
Behavior4/5

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

No annotations exist, so the description carries the full burden, and it does meaningful work: it discloses that rates come from the official AEAT per-year table, that computation is done in tranches, and that accrual starts the day after the due date. It does not state rounding/precision rules or that the tool is purely read-only computation with no side effects, which is implied but not declared.

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 opening sentence front-loads purpose and rate source, and the Args block is terse, one line per parameter, with no filler. The docstring formatting (literal 'Args:' indentation, ellipsis character) is slightly machine-unfriendly but costs no comprehension.

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 5-parameter computation tool with no annotations, the definition covers purpose, legal basis, rate source, date conventions, and every parameter, and an output schema exists so return values need not be described. The only genuine gaps are rounding/convention on the result and any statement about the tool being a pure calculation — minor omissions rather than blockers.

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

Parameters5/5

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

Schema coverage is 0% — the schema carries only bare titles like 'Desde' and 'Tipo Interes' — so the description must compensate entirely, and it does. It documents all five parameters with real semantics: importe is the principal/cuota; desde is the due date with accrual running from the following day; hasta is the final accrual day (payment or settlement); excluir is a list of non-accrual period pairs with their legal basis; and tipo_interes takes «demora» or «legal», an enum the schema does not declare.

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 first line names a specific computation (interest accrual) and its two legal modalities ('intereses de demora tributarios (art. 26 LGT)' vs 'interés legal del dinero'), plus the method (por tramos con los tipos oficiales de cada año, tabla de la AEAT). An agent can tell this apart from siblings like calcular_recargo or calcular_sancion by subject matter, though no sibling is named explicitly.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied by the subject matter: this is the tool for tax late-payment interest or legal money interest, and the exclusion parameter cites arts. 26.4 and 150.6.c LGT, hinting at when exclusions apply. However, the definition never states when NOT to use it (e.g. versus calcular_recargo for surcharges or calcular_plazo for pure date arithmetic), so routing between the many 'calcular_*' siblings is left to inference.

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