Skip to main content
Glama

چیستارا — Iranian Legal Corpus

محاسبهٔ دیه — Calculate blood money (دیه)

calculate_diyeh
Read-onlyIdempotent

Calculate دیه for a bodily injury using the CURRENT official rate and the fractions set by قانون مجازات اسلامی. ALWAYS use this instead of computing دیه yourself: the full-دیه rate changes every Persian year and the per-injury fractions are statutory. Returns the amount with the governing article and the official rate source.

Input Schema

NameRequiredDescriptionDefault
yearNoPersian year (e.g. 1405). Defaults to the latest loaded rate.
countNoHow many (fingers, teeth …). Default 1.
genderNoGender of the injured/deceased.
fractionNoدیه fraction between 0 and 1 — only when no injury_type fits.
death_dateNoJalali date of death when it differs from the act.
injury_typeNoInjury key from the standard list (e.g. full = دیهٔ کامل, hand_one = یک دست, tooth_front = دندان جلویی). Pick the key, not free text.
sacred_monthNoOnly when no date is known: the act AND the death were in a ماه حرام (تغلیظ — a death, injury_type=full, only; ماده ۵۵۷).
incident_dateNoJalali date of the act, e.g. 1405/09/25 — the ماه حرام is derived from the official Hijri calendar (ماده ۵۵۵).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • addedInput schema / properties / death_date
      Added value: +{
      +  "description": "Jalali date of death when it differs from the act.",
      +  "type": "string"
      +}
    • addedInput schema / properties / incident_date
      Added value: +{
      +  "description": "Jalali date of the act, e.g. 1405/09/25 — the ماه حرام is derived from the official Hijri calendar (ماده ۵۵۵).",
      +  "type": "string"
      +}
    • changedInput schema / properties / sacred_month / description
      Previous value: -"Occurred in a ماه حرام (تغلیظ — applies to دیهٔ نفس only)."New value: +"Only when no date is known: the act AND the death were in a ماه حرام (تغلیظ — a death, injury_type=full, only; ماده ۵۵۷)."
  2. Changed1 schema field changed
    • changedInput schema / properties / injury_type / enum
      Previous value: -[
      -  "full",
      -  "eye_one",
      -  "eye_both",
      -  "ear_one",
      -  "ear_both",
      -  "hand_one",
      -  "hand_both",
      -  "foot_one",
      -  "foot_both",
      -  "finger_thumb",
      -  "finger_other",
      -  "finger_phalanx",
      -  "tooth_front",
      -  "tooth_molar",
      -  "nose_full",
      -  "nose_fracture",
      -  "kidney_one",
      -  "kidney_both",
      -  "rib_heart",
      -  "rib_each",
      -  "rib_other",
      -  "spleen",
      -  "skull_fracture",
      -  "spine_fracture",
      -  "spine_fracture_healed",
      -  "spinal_cord",
      -  "eyelid_upper",
      -  "eyelid_lower",
      -  "testicle_left",
      -  "testicle_right"
      -]New value: +[
      +  "full",
      +  "eye_one",
      +  "eye_both",
      +  "ear_one",
      +  "ear_both",
      +  "ear_lobe_one",
      +  "ear_lobe_both",
      +  "hand_one",
      +  "hand_both",
      +  "foot_one",
      +  "foot_both",
      +  "finger_thumb",
      +  "finger_other",
      +  "finger_phalanx",
      +  "finger_thumb_phalanx",
      +  "toe_phalanx",
      +  "toe_thumb_phalanx",
      +  "tooth_front",
      +  "tooth_molar",
      +  "nose_full",
      +  "nose_fracture",
      +  "kidney_one",
      +  "kidney_both",
      +  "rib_heart",
      +  "rib_each",
      +  "rib_other",
      +  "spleen",
      +  "skull_fracture",
      +  "spine_fracture",
      +  "spine_fracture_healed",
      +  "spinal_cord",
      +  "eyelid_upper",
      +  "eyelid_lower",
      +  "testicle_left",
      +  "testicle_right"
      +]
  3. Changed9 schema fields changed
    • addedInput schema / properties / count
      Added value: +{
      +  "description": "How many (fingers, teeth …). Default 1.",
      +  "type": "integer"
      +}
    • addedInput schema / properties / fraction
      Added value: +{
      +  "description": "دیه fraction between 0 and 1 — only when no injury_type fits.",
      +  "type": "number"
      +}
    • addedInput schema / properties / gender
      Added value: +{
      +  "description": "Gender of the injured/deceased.",
      +  "enum": [
      +    "male",
      +    "female"
      +  ],
      +  "type": "string"
      +}
    • removedInput schema / properties / injury
      Removed value: -{
      -  "description": "Injury in Persian, e.g. «شکستگی دست»، «از دست دادن یک انگشت»، «دندان».",
      -  "type": "string"
      -}
    • addedInput schema / properties / injury_type
      Added value: +{
      +  "description": "Injury key from the standard list (e.g. full = دیهٔ کامل, hand_one = یک دست, tooth_front = دندان جلویی). Pick the key, not free text.",
      +  "enum": [
      +    "full",
      +    "eye_one",
      +    "eye_both",
      +    "ear_one",
      +    "ear_both",
      +    "hand_one",
      +    "hand_both",
      +    "foot_one",
      +    "foot_both",
      +    "finger_thumb",
      +    "finger_other",
      +    "finger_phalanx",
      +    "tooth_front",
      +    "tooth_molar",
      +    "nose_full",
      +    "nose_fracture",
      +    "kidney_one",
      +    "kidney_both",
      +    "rib_heart",
      +    "rib_each",
      +    "rib_other",
      +    "spleen",
      +    "skull_fracture",
      +    "spine_fracture",
      +    "spine_fracture_healed",
      +    "spinal_cord",
      +    "eyelid_upper",
      +    "eyelid_lower",
      +    "testicle_left",
      +    "testicle_right"
      +  ],
      +  "type": "string"
      +}
    • removedInput schema / properties / is_haram_month
      Removed value: -{
      -  "description": "Whether it occurred in a حرام month (تغلیظ applies to دیهٔ نفس).",
      -  "type": "boolean"
      -}
    • addedInput schema / properties / sacred_month
      Added value: +{
      +  "description": "Occurred in a ماه حرام (تغلیظ — applies to دیهٔ نفس only).",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / year / description
      Previous value: -"Persian year (e.g. 1405). Defaults to the current year."New value: +"Persian year (e.g. 1405). Defaults to the latest loaded rate."
    • changedInput schema / required
      Previous value: -[
      -  "injury"
      -]New value: +[]
  4. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive, so the safety profile is covered. The description adds real value beyond that: it discloses that the tool auto-applies the CURRENT official rate, uses statutory fractions, and returns the governing article plus rate source. Does not cover edge/failure behavior, but the added context is substantial.

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?

Three tight sentences, front-loaded with purpose, then usage directive, then return shape. Every sentence earns its place with no redundancy.

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?

No output schema exists, and the description compensates by describing the return (amount + governing article + rate source). Given 100% schema coverage and a rich annotation set, the definition is largely self-sufficient; only minor gaps around ambiguous/multi-input cases remain.

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 per-parameter meaning is fully documented in the schema. The description adds only domain framing (current rate, statutory fractions) rather than parameter-specific guidance, so the baseline of 3 is appropriate.

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 (Calculate) and a specific resource (دیه / blood money for bodily injury), which is naturally distinct from the sibling calculators (mahrieh, inheritance, various fees). An agent can tell exactly what this tool computes without opening the schema.

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?

Explicit directive: 'ALWAYS use this instead of computing دیه yourself', with the reason (rate changes yearly, fractions are statutory). Strong when-to-use guidance, though no explicit when-not or named alternatives (e.g. when to prefer a different calculator for a non-injury case).

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