Skip to main content
Glama

Calculate tip

calculate_tip
Read-onlyIdempotent

Calculate a suggested tip and total for a bill using Tipping Rules destination norms (percent or round-up). Returns amounts plus canonical destination and calculator URLs.

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>",
      "bill": "<bill>"
    },
    "name": "calculate_tip"
  }
}

Input Schema

NameRequiredDescriptionDefault
billYesBill amount in local currency units (positive number).
countryYesCountry slug or name for local tipping norms.
serviceNoService category. Prefer restaurant, bar, taxi, delivery, hotelStaff, or tourGuides.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • removedInput schema / properties / bill / anyOf
      Removed value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "string"
      -  }
      -]
    • addedInput schema / properties / bill / type
      Added value: +[
      +  "number",
      +  "string"
      +]
    • changedOutput schema / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "bill": {
      -        "description": "Bill amount in local currency units.",
      -        "exclusiveMinimum": 0,
      -        "type": "number"
      -      },
      -      "calculatorUrl": {
      -        "description": "Deep link to the on-site calculator for this country.",
      -        "format": "uri",
      -        "type": "string"
      -      },
      -      "canonicalUrl": {
      -        "description": "Canonical country page URL.",
      -        "format": "uri",
      -        "type": "string"
      -      },
      -      "country": {
      -        "description": "Display name of the destination.",
      -        "type": "string"
      -      },
      -      "currency": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "description": "ISO currency code when known (e.g. EUR, USD)."
      -      },
      -      "lastReviewed": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "description": "ISO date when guidance was last reviewed, when available."
      -      },
      -      "methodologyUrl": {
      -        "description": "How Tipping Rules reviews and sources guidance.",
      -        "format": "uri",
      -        "type": "string"
      -      },
      -      "mode": {
      -        "description": "Calculation mode applied for this service and destination.",
      -        "enum": [
      -          "percent",
      -          "round_up",
      -          "zero"
      -        ],
      -        "type": "string"
      -      },
      -      "ok": {
      -        "const": true,
      -        "description": "True when the tip was calculated.",
      -        "type": "boolean"
      -      },
      -      "recommendation": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "description": "Human-readable norm string for the selected service."
      -      },
      -      "service": {
      -        "description": "Service category label used for the calculation.",
      -        "type": "string"
      -      },
      -      "slug": {
      -        "description": "Country slug.",
      -        "type": "string"
      -      },
      -      "source": {
      -        "const": "Tipping Rules",
      -        "description": "Attribution for downstream citations.",
      -        "type": "string"
      -      },
      -      "tipAmount": {
      -        "description": "Suggested tip amount in local currency units.",
      -        "type": "number"
      -      },
      -      "tipPercent": {
      -        "anyOf": [
      -          {
      -            "type": "number"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "description": "Applied tip percent when mode is percent; null for round-up."
      -      },
      -      "total": {
      -        "description": "Bill plus suggested tip.",
      -        "type": "number"
      -      }
      -    },
      -    "required": [
      -      "ok",
      -      "country",
      -      "slug",
      -      "service",
      -      "bill",
      -      "currency",
      -      "mode",
      -      "tipPercent",
      -      "tipAmount",
      -      "total",
      -      "recommendation",
      -      "lastReviewed",
      -      "canonicalUrl",
      -      "calculatorUrl",
      -      "methodologyUrl",
      -      "source"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "code": {
      -        "description": "Machine-readable error code (e.g. NOT_FOUND, VALIDATION, TIMEOUT).",
      -        "type": "string"
      -      },
      -      "message": {
      -        "description": "Short, agent-safe error message.",
      -        "type": "string"
      -      },
      -      "ok": {
      -        "const": false,
      -        "description": "False when the tool could not complete successfully.",
      -        "type": "boolean"
      -      }
      -    },
      -    "required": [
      -      "ok",
      -      "code",
      -      "message"
      -    ],
      -    "type": "object"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "bill": {
      +        "description": "Bill amount in local currency units.",
      +        "exclusiveMinimum": 0,
      +        "type": "number"
      +      },
      +      "calculatorUrl": {
      +        "description": "Deep link to the on-site calculator for this country.",
      +        "format": "uri",
      +        "type": "string"
      +      },
      +      "canonicalUrl": {
      +        "description": "Canonical country page URL.",
      +        "format": "uri",
      +        "type": "string"
      +      },
      +      "country": {
      +        "description": "Display name of the destination.",
      +        "type": "string"
      +      },
      +      "currency": {
      +        "description": "ISO currency code when known (e.g. EUR, USD).",
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "lastReviewed": {
      +        "description": "ISO date when guidance was last reviewed, when available.",
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "methodologyUrl": {
      +        "description": "How Tipping Rules reviews and sources guidance.",
      +        "format": "uri",
      +        "type": "string"
      +      },
      +      "mode": {
      +        "description": "Calculation mode applied for this service and destination.",
      +        "enum": [
      +          "percent",
      +          "round_up",
      +          "zero"
      +        ],
      +        "type": "string"
      +      },
      +      "ok": {
      +        "const": true,
      +        "description": "True when the tip was calculated.",
      +        "type": "boolean"
      +      },
      +      "recommendation": {
      +        "description": "Human-readable norm string for the selected service.",
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "service": {
      +        "description": "Service category label used for the calculation.",
      +        "type": "string"
      +      },
      +      "slug": {
      +        "description": "Country slug.",
      +        "type": "string"
      +      },
      +      "source": {
      +        "const": "Tipping Rules",
      +        "description": "Attribution for downstream citations.",
      +        "type": "string"
      +      },
      +      "tipAmount": {
      +        "description": "Suggested tip amount in local currency units.",
      +        "type": "number"
      +      },
      +      "tipPercent": {
      +        "description": "Applied tip percent when mode is percent; null for round-up.",
      +        "type": [
      +          "number",
      +          "null"
      +        ]
      +      },
      +      "total": {
      +        "description": "Bill plus suggested tip.",
      +        "type": "number"
      +      }
      +    },
      +    "required": [
      +      "ok",
      +      "country",
      +      "slug",
      +      "service",
      +      "bill",
      +      "currency",
      +      "mode",
      +      "tipPercent",
      +      "tipAmount",
      +      "total",
      +      "recommendation",
      +      "lastReviewed",
      +      "canonicalUrl",
      +      "calculatorUrl",
      +      "methodologyUrl",
      +      "source"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "code": {
      +        "description": "Machine-readable error code (e.g. NOT_FOUND, VALIDATION, TIMEOUT).",
      +        "type": "string"
      +      },
      +      "message": {
      +        "description": "Short, agent-safe error message.",
      +        "type": "string"
      +      },
      +      "ok": {
      +        "const": false,
      +        "description": "False when the tool could not complete successfully.",
      +        "type": "boolean"
      +      }
      +    },
      +    "required": [
      +      "ok",
      +      "code",
      +      "message"
      +    ],
      +    "type": "object"
      +  }
      +]
  2. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "https://json-schema.org/draft/2020-12/schema",
      +  "anyOf": [
      +    {
      +      "additionalProperties": false,
      +      "properties": {
      +        "bill": {
      +          "description": "Bill amount in local currency units.",
      +          "exclusiveMinimum": 0,
      +          "type": "number"
      +        },
      +        "calculatorUrl": {
      +          "description": "Deep link to the on-site calculator for this country.",
      +          "format": "uri",
      +          "type": "string"
      +        },
      +        "canonicalUrl": {
      +          "description": "Canonical country page URL.",
      +          "format": "uri",
      +          "type": "string"
      +        },
      +        "country": {
      +          "description": "Display name of the destination.",
      +          "type": "string"
      +        },
      +        "currency": {
      +          "anyOf": [
      +            {
      +              "type": "string"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ],
      +          "description": "ISO currency code when known (e.g. EUR, USD)."
      +        },
      +        "lastReviewed": {
      +          "anyOf": [
      +            {
      +              "type": "string"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ],
      +          "description": "ISO date when guidance was last reviewed, when available."
      +        },
      +        "methodologyUrl": {
      +          "description": "How Tipping Rules reviews and sources guidance.",
      +          "format": "uri",
      +          "type": "string"
      +        },
      +        "mode": {
      +          "description": "Calculation mode applied for this service and destination.",
      +          "enum": [
      +            "percent",
      +            "round_up",
      +            "zero"
      +          ],
      +          "type": "string"
      +        },
      +        "ok": {
      +          "const": true,
      +          "description": "True when the tip was calculated.",
      +          "type": "boolean"
      +        },
      +        "recommendation": {
      +          "anyOf": [
      +            {
      +              "type": "string"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ],
      +          "description": "Human-readable norm string for the selected service."
      +        },
      +        "service": {
      +          "description": "Service category label used for the calculation.",
      +          "type": "string"
      +        },
      +        "slug": {
      +          "description": "Country slug.",
      +          "type": "string"
      +        },
      +        "source": {
      +          "const": "Tipping Rules",
      +          "description": "Attribution for downstream citations.",
      +          "type": "string"
      +        },
      +        "tipAmount": {
      +          "description": "Suggested tip amount in local currency units.",
      +          "type": "number"
      +        },
      +        "tipPercent": {
      +          "anyOf": [
      +            {
      +              "type": "number"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ],
      +          "description": "Applied tip percent when mode is percent; null for round-up."
      +        },
      +        "total": {
      +          "description": "Bill plus suggested tip.",
      +          "type": "number"
      +        }
      +      },
      +      "required": [
      +        "ok",
      +        "country",
      +        "slug",
      +        "service",
      +        "bill",
      +        "currency",
      +        "mode",
      +        "tipPercent",
      +        "tipAmount",
      +        "total",
      +        "recommendation",
      +        "lastReviewed",
      +        "canonicalUrl",
      +        "calculatorUrl",
      +        "methodologyUrl",
      +        "source"
      +      ],
      +      "type": "object"
      +    },
      +    {
      +      "additionalProperties": false,
      +      "properties": {
      +        "code": {
      +          "description": "Machine-readable error code (e.g. NOT_FOUND, VALIDATION, TIMEOUT).",
      +          "type": "string"
      +        },
      +        "message": {
      +          "description": "Short, agent-safe error message.",
      +          "type": "string"
      +        },
      +        "ok": {
      +          "const": false,
      +          "description": "False when the tool could not complete successfully.",
      +          "type": "boolean"
      +        }
      +      },
      +      "required": [
      +        "ok",
      +        "code",
      +        "message"
      +      ],
      +      "type": "object"
      +    }
      +  ],
      +  "description": "Tip calculation result or a structured error.",
      +  "type": "object"
      +}
  3. First observed

TDQS

A3.7/5.0
Behavior3/5

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

Annotations already declare readOnly, idempotent, non-destructive, so safety needs no restating. The description does add useful behavior: two calculation modes (percent vs round-up) and that canonical destination/calculator URLs are returned. However, with an output schema present, much of the return-value disclosure is redundant.

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 tight sentences, zero filler, with the core purpose front-loaded and the return content second. Slightly dense list of outputs but efficient overall.

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 a full-coverage schema, complete annotations, and an output schema, the description covers the remaining gaps (calculation modes, canonical URLs). It is essentially complete for a deterministic read-only calculator, missing only explicit routing guidance toward siblings.

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 100% and all three parameters (bill, country, service) are documented in the schema, so the schema does the heavy lifting. The description adds no format or unit detail beyond that, which is the expected baseline when coverage is complete.

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+resource ('Calculate a suggested tip and total for a bill') with the scoping mechanism named ('Tipping Rules destination norms'). This clearly distinguishes it from get_tipping_rules (fetch rules) and search_countries (look up countries), so an agent can route 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 Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied by the description ('for a bill', requires country + bill) but there is no explicit when-to-use/when-not guidance and no reference to the siblings. An agent can infer it should call this to compute an amount rather than fetch rules, but nothing spells that out.

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