Skip to main content
Glama

calcular_gastos_deducibles_autonomo

Read-only

Calcula los gastos fiscalmente deducibles en el IRPF de un autónomo en estimación directa (normal o simplificada). Aplica las reglas especiales: suministros de la vivienda habitual (% de afectación × 30%), vehículo (en IRPF solo si está afecto en exclusiva o es de transporte, agente comercial o autoescuela; el uso mixto no deduce), seguros médicos (límite 500 €/persona), amortizaciones y, en estimación directa simplificada, el 5 % de difícil justificación sobre el rendimiento neto (máx. 2.000 €/año).

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": {
      "modalidad": "<modalidad>",
      "tipo_local": "<tipo_local>"
    },
    "name": "calcular_gastos_deducibles_autonomo"
  }
}

Input Schema

NameRequiredDescriptionDefault
modalidadYesModalidad de estimación directa
tipo_localYes"local_independiente" (100% deducible) o "vivienda_habitual" (% por afectación)
gasto_localNoGastos de local o alquiler de oficina (€/año)
otros_gastosNoOtros gastos deducibles: formación, suscripciones, gestoría... (€/año)
amortizacionesNoAmortización de inmovilizado: equipos, mobiliario, software (€/año)
cuota_autonomoNoCuota de autónomo (RETA) pagada en el año (€/año). 100% deducible.
gastos_comprasNoCompras de materiales y mercaderías (€/año)
gastos_personalNoNóminas de empleados + SS empresa (€/año)
gastos_vehiculoNoTotal de gastos del vehículo: combustible, seguro, ITV, reparaciones (€/año)
ingresos_anualesNoIngresos de la actividad en el año (€). Solo en ED simplificada: con ellos se calcula el 5 % de difícil justificación sobre el rendimiento neto (máx. 2.000 €).
gastos_financierosNoIntereses de préstamos de la actividad y comisiones bancarias (€/año)
gastos_suministrosNoSuministros: luz, agua, gas, internet (€/año)
pct_vivienda_afectaNoSolo si tipo_local=vivienda_habitual: % de la vivienda destinado a la actividad (m² despacho / m² total × 100)
vehiculo_uso_exclusivoNotrue si el vehículo está afecto en exclusiva a la actividad o es mixto de mercancías, de transporte de viajeros, de autoescuela, de representante o agente comercial o de alquiler habitual (100 % deducible). false si también se usa para fines privados: en IRPF no deduce. Por defecto false.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • addedInput schema / properties / ingresos_anuales
      Added value: +{
      +  "description": "Ingresos de la actividad en el año (€). Solo en ED simplificada: con ellos se calcula el 5 % de difícil justificación sobre el rendimiento neto (máx. 2.000 €).",
      +  "minimum": 0,
      +  "type": "number"
      +}
    • removedInput schema / properties / saldo_deudores_fin_anio
      Removed value: -{
      -  "description": "Saldo de clientes/deudores al cierre del ejercicio (€). Solo en ED simplificada: permite deducir la provisión global del 5%.",
      -  "minimum": 0,
      -  "type": "number"
      -}
    • changedInput schema / properties / vehiculo_uso_exclusivo / description
      Previous value: -"¿El vehículo se dedica exclusivamente a la actividad (transporte/reparto)? true=100% deducible, false=50% (uso mixto). Por defecto false."New value: +"true si el vehículo está afecto en exclusiva a la actividad o es mixto de mercancías, de transporte de viajeros, de autoescuela, de representante o agente comercial o de alquiler habitual (100 % deducible). false si también se usa para fines privados: en IRPF no deduce. Por defecto false."
  2. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Beyond readOnlyHint=true, it discloses real behavioral traits: suministros at % afectación × 30%, vehicle deductibility only when exclusively affected or special cases, medical insurance capped at 500 €/person, and the 5 % difícil justificación capped at 2.000 €/year in simplificada. It omits what the response contains (no output schema exists) and does not explain how the medical-insurance cap maps to an input parameter.

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?

Front-loaded with purpose in the first clause, then a compact enumeration of the special rules; every sentence carries computational information. It is one long sentence-chain rather than structured bullets, which slightly hurts scanability but wastes no words.

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 14-parameter calculator with no output schema, the description covers the deduction logic thoroughly enough to call it correctly, including the two enum-driven branches. The main gap is that it never outlines the return value (per-category breakdown vs. single total), which an agent would need to interpret results.

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 100 %, so a 3 would be the floor, but the description adds genuine meaning: it explains that ingresos_anuales only matters in simplificada for the 5 % calculation, that vivienda_habitual triggers the m² afectación prorating, and that mixed-use vehicles do not deduct in IRPF at all. Only the medical-insurance rule is left unmapped to a concrete parameter.

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 ('Calcula') plus the exact resource and scope: gastos fiscalmente deducibles en el IRPF de un autónomo en estimación directa normal o simplificada. That scope cleanly separates it from siblings like calcular_irpf, calcular_modelo_130 or calcular_cuota_autonomo without needing their schemas.

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?

The description fixes the applicable regime (estimación directa, both modalidades) and enumerates the special rules it handles, so the agent knows which cases route here. It does not name an alternative tool or state explicit exclusions (e.g. what to use for estimación objetiva/módulos), which keeps it just below a 5.

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