Skip to main content
Glama

Withholding tax on a payment

calculate_withholding_tax
Read-onlyIdempotent

The tax to withhold on one payment from a country to a recipient resident in another country (or the same one): applies the domestic rate and, for a non-resident, the tax-treaty maximum (the lower one), and returns the rate, the amount withheld and the net payment, with the sources. With amount_is 'net', grosses the payment up. Where the data cannot decide (treaty rates by condition such as 5/15, several domestic rates), every option is returned with its condition; where a rate is not recorded, no amount is given.

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": {
      "country": "<country>",
      "payment_type": "<payment_type>",
      "amount": "<amount>",
      "recipient_country": "<recipient_country>"
    },
    "name": "calculate_withholding_tax"
  }
}

Input Schema

NameRequiredDescriptionDefault
dateNoOptional YYYY-MM-DD: use the rates in force on that date where a dated period covers it (otherwise no amount)
amountYesPayment amount in its currency
countryYesPaying country (ISO 3166-1 alpha-2), e.g. KE
amount_isNoOptional: 'gross' (default, the amount before tax) or 'net' (the recipient must receive this amount; the payment is grossed up)
payment_typeYes
recipient_countryYesRecipient's country of residence (ISO code); the paying country itself for a resident recipient

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Beyond the readOnly/idempotent/non-destructive annotations, the description discloses genuine behavioral traits: domestic rate vs. lower treaty maximum selection, ambiguity handling (every option returned with its condition), and failure behaviour (no amount when a rate is unrecorded). It stops short of describing determinism, rounding, or the shape of the returned source citations, but the annotations already remove the safety burden.

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?

It is a single dense but front-loaded sentence-plus clause that establishes the core computation before covering edge cases. The deep nesting of parentheticals ('5/15', 'several domestic rates') makes it slightly harder to scan, but no sentence is wasted.

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?

With no output schema, the description carries the burden of explaining returns, and it does so by naming rate, amount withheld, net payment and sources. The main remaining gap is the absence of explicit sibling routing and of any note on result currency or precision for a 6-parameter tool.

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 coverage is 83%, so the schema already explains date, amount, country, amount_is and recipient_country thoroughly. The description reinforces amount_is='net' gross-up and the dated-rate constraint but adds little syntax or meaning not already present in the property descriptions; baseline 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?

The description names a specific computation (withholding tax on one payment) with explicit scope: a payment from one country to a recipient resident in another (or the same) country. It states the exact outputs (rate, amount withheld, net payment, sources), so an agent can distinguish it from the rate-lookup sibling get_withholding_tax.

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?

Usage context is clear: it is for computing tax on a single payment, and the 'amount_is net' case is called out with its gross-up consequence. It does not, however, explicitly route the agent between this tool and get_withholding_tax (lookup of rates/treaties), which is the most likely alternative an agent would consider.

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