Skip to main content
Glama

calcular_deduccion_maternidad_irpf

Read-only

Calcula la deducción por maternidad en el IRPF (art. 81 LIRPF): 1.200 €/año por hijo menor de 3 años, más el incremento por gastos de guardería (hasta 1.000 €/año POR CADA HIJO). Da derecho cualquiera de las TRES vías alternativas del art. 81.1: estar de alta en la Seguridad Social o mutualidad, percibir prestación o subsidio de desempleo al nacer el menor, o darse de alta después del nacimiento y alcanzar 30 días cotizados (esta última suma 150 € por hijo, art. 81.3). La reforma de 2023 (Ley 31/2022) amplió esas vías, no las suprimió: sin ninguna de ellas la deducción es 0 €. Aplica el límite por cotizaciones a la Seguridad Social y descuenta el abono anticipado ya cobrado.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hijosYesLista de hijos menores de 3 años
situacionNoVía del art. 81.1 por la que se accede: "alta" (de alta en SS o mutualidad), "desempleo" (prestación o subsidio de desempleo al nacer el menor), "alta-posterior" (alta tras el nacimiento con 30 días cotizados; suma 150 €/hijo) o "ninguna" (ninguna de las tres → deducción 0 €). Por defecto "alta".
madre_en_activoNoOBSOLETO: usar "situacion". Solo se lee si no se indica "situacion": false equivale a "ninguna" y true a "alta".
cotizaciones_ss_anualesYesSuma de las cotizaciones de la madre a la Seguridad Social en el año (€) — límite de la deducción base
importe_abono_anticipado_cobradoNoImporte ya cobrado por abono anticipado (modelo 140) en €. Por defecto 0.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • changedInput schema / properties / hijos / items / properties / gastos_guarderia_anuales / description
      Previous value: -"Gastos anuales de guardería o centro autorizado de este hijo (€). Por defecto 0."New value: +"Gastos anuales de guardería o centro autorizado de este hijo (€). Por defecto 0. El tope de 1.000 € se aplica a cada hijo por separado."
    • changedInput schema / properties / madre_en_activo / description
      Previous value: -"¿La madre está de alta como trabajadora o cobrando prestación contributiva? Por defecto true."New value: +"OBSOLETO: usar \"situacion\". Solo se lee si no se indica \"situacion\": false equivale a \"ninguna\" y true a \"alta\"."
    • addedInput schema / properties / situacion
      Added value: +{
      +  "description": "Vía del art. 81.1 por la que se accede: \"alta\" (de alta en SS o mutualidad), \"desempleo\" (prestación o subsidio de desempleo al nacer el menor), \"alta-posterior\" (alta tras el nacimiento con 30 días cotizados; suma 150 €/hijo) o \"ninguna\" (ninguna de las tres → deducción 0 €). Por defecto \"alta\".",
      +  "enum": [
      +    "alta",
      +    "desempleo",
      +    "alta-posterior",
      +    "ninguna"
      +  ],
      +  "type": "string"
      +}
  2. Added

TDQS

A4.5/5.0
Behavior4/5

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

Annotations declare readOnlyHint=true, so the safety profile is already known. The description adds valuable behavioral context: the 2023 reform (Ley 31/2022) expanded the routes, the per-child daycare cap of 1.000 €, the 150 € addition for alta-posterior, and the fact that the deduction is limited by cotizaciones and reduced by abono anticipado. It also flags that 'madre_en_activo' is obsolete, which is important behavioral information not in the schema. 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.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is dense but well-structured: it front-loads the core calculation (1.200 €/año + guardería increment), then explains the access routes, the legal reform, and the limits. Every sentence carries substantive information. It is longer than ideal but the complexity of the Spanish tax deduction justifies the length. The obsolete parameter warning is a useful addition.

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 calculation tool with no output schema, the description covers the main inputs (hijos, situacion, cotizaciones, abono anticipado) and the key rules. It doesn't explicitly describe the return value format, but for a calculator that's less critical. The description is complete enough for an agent to invoke it correctly, especially with 100% schema coverage and the obsolete parameter warning.

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 description coverage is 100%, so the baseline is 3. The description adds meaning beyond the schema by explaining the legal context of the 'situacion' parameter (the three vías of art. 81.1), the per-child nature of the daycare cap, and the 150 €/hijo addition for 'alta-posterior'. It also clarifies that 'madre_en_activo' is obsolete and how it maps to 'situacion'. This goes beyond the schema's field descriptions.

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 states a specific verb ('Calcula'), a precise resource ('deducción por maternidad en el IRPF'), and the legal article (art. 81 LIRPF). It clearly distinguishes this from sibling tools like calcular_prestacion_maternidad_paternidad by focusing on the tax deduction rather than the benefit. The scope is unambiguous: 1.200 €/año per child under 3, plus daycare increment.

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 explicitly explains the three alternative access routes (alta, desempleo, alta-posterior) and states that without any of them the deduction is 0 €. It also mentions the limit by cotizaciones and the abono anticipado discount. This gives clear when-to-use guidance and the 'ninguna' route is explicitly described as yielding 0 €, which helps an agent decide whether to call this tool at all.

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