Skip to main content
Glama

چیستارا — Iranian Legal Corpus

محاسبهٔ حق‌الوکاله — Calculate lawyer fee (bar tariff)

calculate_lawyer_fee
Read-onlyIdempotent

Calculate حق‌الوکاله from آیین‌نامهٔ تعرفهٔ حق‌الوکاله (1398/12/28): financial claims are a marginal ladder on the claim value (art. 9); family, non-financial, criminal and administrative matters are a min–max RANGE independent of value (arts. 13, 14, 20). stage is art. 21's share of the whole-case fee (60% first instance / 40% appeal). The tariff does not scale by winning or losing. Never guess a lawyer's statutory fee.

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": {
      "stage": "<stage>"
    },
    "name": "calculate_lawyer_fee"
  }
}

Input Schema

NameRequiredDescriptionDefault
stageYesfirst = 60%, appeal = 40%, cassation = on the appeal tariff (arts. 16–17).
outcomeNoHow the case ends (default judgment). Settlement is paid in full (art. 23); art. 12 halves or quarters a fee for قرار رد / ابطال.
case_typeNocivil = financial claim (art. 9); family = family/حسبی (art. 13a); non_financial (art. 13b); criminal (art. 14, needs criminal_grade); admin = دیوان عدالت اداری / تعزیرات (art. 20); board = non-judicial boards e.g. labour (art. 20).
membershipNobar = Bar Association member (fund 50% + bar 25% of the stamp); center = مرکز وکلا member (5% of the fee) — bylaw art. 29.
criminal_gradeNoCriminal only: court (کیفری یک / دو) and offence grade.
case_value_tomanNoClaim value in Toman — civil only.
contract_fee_tomanNoFee written in the power of attorney, in Toman — for the 5% tax stamp (Direct Taxes Act art. 103), which is never below the tariff floor.
final_at_first_instanceNoCivil only: first-instance judgment is final as to value ⇒ flat 10% (art. 9 opening).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / properties / contract_fee_toman
      Added value: +{
      +  "description": "Fee written in the power of attorney, in Toman — for the 5% tax stamp (Direct Taxes Act art. 103), which is never below the tariff floor.",
      +  "type": "number"
      +}
    • addedInput schema / properties / membership
      Added value: +{
      +  "description": "bar = Bar Association member (fund 50% + bar 25% of the stamp); center = مرکز وکلا member (5% of the fee) — bylaw art. 29.",
      +  "enum": [
      +    "bar",
      +    "center"
      +  ],
      +  "type": "string"
      +}
  2. Changed9 schema fields changed
    • changedInput schema / properties / case_type / description
      Previous value: -"Case type."New value: +"civil = financial claim (art. 9); family = family/حسبی (art. 13a); non_financial (art. 13b); criminal (art. 14, needs criminal_grade); admin = دیوان عدالت اداری / تعزیرات (art. 20); board = non-judicial boards e.g. labour (art. 20)."
    • changedInput schema / properties / case_type / enum
      Previous value: -[
      -  "civil",
      -  "criminal",
      -  "admin"
      -]New value: +[
      +  "civil",
      +  "family",
      +  "non_financial",
      +  "criminal",
      +  "admin",
      +  "board"
      +]
    • changedInput schema / properties / case_value_toman / description
      Previous value: -"Case value in Toman."New value: +"Claim value in Toman — civil only."
    • addedInput schema / properties / criminal_grade
      Added value: +{
      +  "description": "Criminal only: court (کیفری یک / دو) and offence grade.",
      +  "enum": [
      +    "k1_grade1",
      +    "k1_grade2_3",
      +    "k1_other",
      +    "k2_hodud_diyat_grade4_5",
      +    "k2_grade6",
      +    "k2_other"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / final_at_first_instance
      Added value: +{
      +  "description": "Civil only: first-instance judgment is final as to value ⇒ flat 10% (art. 9 opening).",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / outcome / description
      Previous value: -"Case outcome (or projection)."New value: +"How the case ends (default judgment). Settlement is paid in full (art. 23); art. 12 halves or quarters a fee for قرار رد / ابطال."
    • changedInput schema / properties / outcome / enum
      Previous value: -[
      -  "full_win",
      -  "partial_win",
      -  "settlement",
      -  "lose"
      -]New value: +[
      +  "judgment",
      +  "settlement",
      +  "dismissed_no_merits",
      +  "rejected_after_defence",
      +  "voided_before_defence"
      +]
    • changedInput schema / properties / stage / description
      Previous value: -"Court stage."New value: +"first = 60%, appeal = 40%, cassation = on the appeal tariff (arts. 16–17)."
    • changedInput schema / required
      Previous value: -[
      -  "stage",
      -  "outcome"
      -]New value: +[
      +  "stage"
      +]
  3. First observed

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare this as a read-only, idempotent, non-destructive computation, so the safety profile is covered. The description adds genuinely new behavioral context: the result is a deterministic tariff figure that does not scale by winning or losing, and `stage` is a proportional share of the whole-case fee. It does not state what the returned value looks like or its units, which is the remaining gap.

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 the core computation model (ladder vs. range), then the stage-share rule, then the outcome-independence caveat and a routing imperative. Dense with statutory citations but each sentence carries a distinct, actionable fact; slightly citation-heavy but not padded.

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 complex 8-parameter, high-enum tool with no output schema, the description covers the branching logic (which case types use which tariff article) and the fee's outcome-independence, which is what an agent needs to pick parameters correctly. The only omission is what the tool returns and in what units, though the schema's Toman-denominated fields make this largely inferable.

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?

With 100% schema coverage the baseline is 3, but the description adds cross-parameter logic the schema does not: it explains the ladder-vs-range split that determines whether case_value_toman even matters, and clarifies that stage is art. 21's share of the whole-case fee. That dependency structure meaningfully improves correct parameter selection.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (calculate) and resource (حق‌الوکاله / lawyer's statutory fee) and pins the exact source of truth (آیین‌نامهٔ تعرفهٔ حق‌الوکاله 1398/12/28), which implicitly separates it from the other fee calculators in the sibling set. It never names a sibling directly nor says which calculator to use for court costs, arbitration, or expert fees, so sibling routing is left to inference.

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?

Gives concrete conditional usage: financial claims follow the art. 9 ladder, while family/non-financial/criminal/admin matters are a value-independent min–max range, and the closing imperative 'Never guess a lawyer's statutory fee' tells the agent to always route here rather than estimate. It stops short of explicit when-not or alternative-tool direction (e.g., vs. calculate_litigation_fee).

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.