Skip to main content
Glama

چیستارا — Iranian Legal Corpus

محاسبهٔ سهم‌الارث — Calculate inheritance shares

calculate_inheritance
Read-onlyIdempotent

Calculate Iranian inheritance shares (سهم‌الارث) of the spouse, parents and children under قانون مدنی arts. 861–949 (رد، نقص، the mother's حاجب), in exact fractions that always sum to the estate. Grandchildren and class-2/3 heirs (siblings, grandparents, uncles …) are refused with the governing articles, never estimated — do not compute those yourself.

Input Schema

NameRequiredDescriptionDefault
son_countNoNumber of sons.
has_fatherNoFather alive?
has_motherNoMother alive?
has_spouseNoSurviving spouse?
wife_countNoPermanent wives of a male deceased, 1–4 (ماده ۹۴۲).
sister_countNoFull or paternal sisters of the deceased (ماده ۸۹۲ ب).
brother_countNoFull or paternal brothers of the deceased (ماده ۸۹۲ ب).
sibling_countNoDeceased's siblings when their sex is unknown (for the mother's حاجب). Prefer brother_count / sister_count.
daughter_countNoNumber of daughters.
deceased_genderYesGender of the deceased.
total_assets_tomanYesTotal estate value in Toman.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • addedInput schema / properties / brother_count
      Added value: +{
      +  "description": "Full or paternal brothers of the deceased (ماده ۸۹۲ ب).",
      +  "type": "integer"
      +}
    • changedInput schema / properties / sibling_count / description
      Previous value: -"Deceased's siblings (for حجب نقصانی)."New value: +"Deceased's siblings when their sex is unknown (for the mother's حاجب). Prefer brother_count / sister_count."
    • addedInput schema / properties / sister_count
      Added value: +{
      +  "description": "Full or paternal sisters of the deceased (ماده ۸۹۲ ب).",
      +  "type": "integer"
      +}
    • addedInput schema / properties / wife_count
      Added value: +{
      +  "description": "Permanent wives of a male deceased, 1–4 (ماده ۹۴۲).",
      +  "type": "integer"
      +}
  2. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already cover read-only, idempotent, non-destructive, closed-world behavior, so the description only needs to add what they cannot. It does add real behavioral context: output is exact fractions that always sum to the estate, and out-of-scope heirs produce a refusal carrying the governing articles rather than an estimate. It stops short of describing return structure, precision/rounding, or currency handling.

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?

Two dense sentences, front-loaded with the core purpose before the scope restriction, with no filler. The parenthetical Persian legal terms carry genuine signal, though the second sentence is long and packs the refusal policy, its rationale, and a directive into one breath.

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 an 11-parameter calculation tool with no output schema, the description supplies the key contract (fractions summing to the estate, refusals with citations) but never sketches the shape of a successful response — per-heir breakdown, article citations, or units — which the missing output schema leaves undocumented.

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 earns an extra point by framing the parameter space conceptually — spouse/parents/children are the accepted inputs, and the mother's حاجب (mapped to sibling_count/brother_count/sister_count) is a recognized input dimension. It adds meaning beyond the terse per-field schema text.

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 and resource ('Calculate Iranian inheritance shares ... of the spouse, parents and children') plus the governing legal basis (arts. 861–949). It is unmistakably distinct from the fee/tax/lookup siblings in the toolset, and even enumerates the doctrines handled (رد، نقص، mother's حاجب).

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?

Explicitly states the boundary condition: grandchildren and class-2/3 heirs are refused, 'never estimated — do not compute those yourself,' which tells the agent when not to expect a result and not to substitute its own math. It does not, however, name the sibling tool (e.g., lookup_law_article) to route to for those refused cases.

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