Skip to main content
Glama

calcular_legitimas

Read-only

Calcula la herencia forzosa (legítima) que corresponde por ley a los descendientes según el régimen civil aplicable en España (Derecho Común, Cataluña, Aragón, Galicia, Baleares, País Vasco o Navarra). Devuelve la legítima total, la parte por hijo, el tercio de mejora, la parte de libre disposición y el derecho del cónyuge viudo. Si no hay descendientes, en Derecho Común calcula la legítima de los ascendientes (CC art. 809) siempre que se indique "tienen_ascendientes". No calcula el Impuesto de Sucesiones (para eso usa "calcular_sucesiones").

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
regimenYesRégimen civil aplicable. "comun" = Código Civil (mayoría de CCAA); el resto son derechos forales.
num_hijosYesNúmero de hijos o descendientes
tiene_conyugeNo¿Hay cónyuge viudo con derecho a usufructo/cuota vidual? Por defecto false.
patrimonio_netoYesPatrimonio neto hereditario (caudal relicto) en euros
tienen_ascendientesNo¿Viven los padres u otros ascendientes del causante? SOLO se usa cuando num_hijos es 0: sin descendientes la legítima pasa a los ascendientes (CC art. 809) y sin ellos no hay legítima. Con num_hijos 0 y régimen "comun" es OBLIGATORIO indicarlo; con hijos se ignora, porque los descendientes excluyen a los ascendientes (CC art. 807).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / tienen_ascendientes
      Added value: +{
      +  "description": "¿Viven los padres u otros ascendientes del causante? SOLO se usa cuando num_hijos es 0: sin descendientes la legítima pasa a los ascendientes (CC art. 809) y sin ellos no hay legítima. Con num_hijos 0 y régimen \"comun\" es OBLIGATORIO indicarlo; con hijos se ignora, porque los descendientes excluyen a los ascendientes (CC art. 807).",
      +  "type": "boolean"
      +}
  2. Added

TDQS

A4.2/5.0
Behavior3/5

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

Annotations indicate readOnlyHint=true, so the description doesn't need to emphasize non-destructiveness. It adds context about the calculation logic (e.g., no descendants → ascendants legítima, CC art. 809) and notes what it does NOT calculate (succession tax). However, it doesn't mention potential complexity like regional variations in detail or that results are estimates; still, the description aligns with readOnlyHint and adds some behavioral context, so a 3 is fair.

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?

The description is concise, front-loaded with the core purposeaine and exceptions, and every sentence adds value. It mentions what it returns, conditions for ascendants, and a cross-reference to the sibling tool. No redundancy with schemas.

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?

The description is comprehensive for a tool without an output schema: it lists the outputs (legítima total, part per child, tercio de mejora, etc.), clarifies the ascendant case, and refers to the sibling for tax. The only minor gap is not specifying that the calculations are estimates or may require legal advice, but given the annotations and schema, the information is sufficient for an agent to invoke 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 each parameter is already described. The description adds meaning to 'tienen_ascendientes' by explaining its conditional usage and legal basis (CC art. 807/809), which is beyond the schema. However, it doesn't clarify the units or format of 'patrimonio_neto' (schema already says euros), nor does it elaborate on 'regimen' beyond the enum. Thus, a 3 is appropriate because schema does the heavy lifting but description adds critical conditional context.

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 clearly states the tool calculates the forced heirship (legítima) under Spanish civil law, specifies the legal regimes covered, lists the returned components, and distinguishes from the inheritance tax tool (calcular_sucesiones). This is a specific verb+resource with clear differentiation from siblings like calcular_sucesiones and consulta_herencia.

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?

It explicitly states when to use it (for calculating legítima) and when not to (for inheritance tax, pointing to 'calcular_sucesiones'). It also provides conditional guidance on when the 'tienen_ascendientes' parameter is required (when num_hijos=0 and régimen 'comun') and when it is ignored (with hijos). This is exemplary usage guidance.

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