Skip to main content
Glama
tresor4k

macalc

by tresor4k

calculate_vat_generic

Read-onlyIdempotent

Calculate VAT, GST, or sales tax for any rate and country. Given an amount and tax rate, returns amounts before tax, after tax, and the tax amount, with support for before-tax or after-tax input.

Instructions

Add or remove VAT/GST/sales tax at any custom rate, for any country. Inputs: amount, rate (tax rate in percent) and optional mode (whether amount is before-tax or after-tax — see enum). Returns amount before tax, amount after tax and the tax amount. Read-only and deterministic. Country-specific helpers (French/UK/Swiss VAT…) exist in the full catalog via get_bundle_tools('finance-universal').

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNoht=before tax, ttc=after taxht
rateYesTax rate in %
amountYesAmount

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.4.0
    • changedOutput schema / (root)
      Previous value: -{
      -  "$schema": "http://json-schema.org/draft-07/schema#",
      -  "additionalProperties": false,
      -  "properties": {
      -    "formula": {
      -      "description": "Human-readable formula or method used (e.g. \"I=P·r·t\", \"Magnus formula\").",
      -      "type": "string"
      -    },
      -    "reference_url": {
      -      "description": "Link to a calcul2 page documenting the calculation in detail.",
      -      "type": "string"
      -    },
      -    "result": {
      -      "description": "Computed result. Object whose fields depend on the tool (e.g. {tax, marginal_rate, brackets} for tax tools, {volume_l, gallons} for volume tools)."
      -    },
      -    "source": {
      -      "description": "Authoritative source for the rule or formula (e.g. \"Article 197 CGI\", \"NF DTU 21\").",
      -      "type": "string"
      -    }
      -  },
      -  "type": "object"
      -}New value: +null
  2. Changed1 schema field changedv0.1.4
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": false,
      +  "properties": {
      +    "formula": {
      +      "description": "Human-readable formula or method used (e.g. \"I=P·r·t\", \"Magnus formula\").",
      +      "type": "string"
      +    },
      +    "reference_url": {
      +      "description": "Link to a calcul2 page documenting the calculation in detail.",
      +      "type": "string"
      +    },
      +    "result": {
      +      "description": "Computed result. Object whose fields depend on the tool (e.g. {tax, marginal_rate, brackets} for tax tools, {volume_l, gallons} for volume tools)."
      +    },
      +    "source": {
      +      "description": "Authoritative source for the rule or formula (e.g. \"Article 197 CGI\", \"NF DTU 21\").",
      +      "type": "string"
      +    }
      +  },
      +  "type": "object"
      +}
  3. Added

TDQS

A4.5/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. Description adds return format (before tax, after tax, tax amount) and reaffirms deterministic behavior, providing useful behavioral context beyond annotations.

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?

Four concise sentences: purpose, inputs, outputs, and additional context. Every sentence adds value without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema, but description explains return values. Mentions country-specific alternatives. Covers all necessary information for a tax calculation 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 covers 100% of parameters with descriptions. Description restates inputs but adds minimal new information (e.g., 'rate in percent') beyond what schema provides. Baseline score 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?

Description clearly states it adds/removes VAT/GST/sales tax at custom rate for any country, distinguishing it from sibling tools like calculate_percentage or country-specific tax calculators.

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?

Explicitly tells when to use (custom rate, any country) and when to use alternatives (country-specific helpers via get_bundle_tools). Also notes deterministic, read-only nature.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.