Skip to main content
Glama
josemvelez78

mcp-europe-business

format_number_european

Read-onlyIdempotent

Formats numeric values according to European country locale conventions, transforming decimal and thousands separators for accurate regional display.

Instructions

Formats a number using the locale conventions of a specific European country — correct decimal and thousands separators. Returns { original, formatted, locale, country_code }. Supports PT, ES, FR, DE, IT, NL, BE, PL, SE, DK, FI, AT, IE, GR, HU, RO, UK.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
numberYesThe numeric value to format. Example: 1234.56
country_codeYesTwo-letter country code. Example: 'PT', 'FR', 'DE'
decimalsNoNumber of decimal places. Defaults to 2.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
originalYes
formattedYes
localeYes
country_codeYes

Implementation Reference

  • The tool handler function for 'format_number_european' — formats a number using European locale conventions (decimal and thousands separators) via Intl.NumberFormat. Maps country codes to locale strings and returns the formatted result.
    // ── 11. Format Number European ──
    server.registerTool("format_number_european", {
      description: "Formats a number using the locale conventions of a specific European country — correct decimal and thousands separators. Returns { original, formatted, locale, country_code }. Supports PT, ES, FR, DE, IT, NL, BE, PL, SE, DK, FI, AT, IE, GR, HU, RO, UK.",
      inputSchema: {
        number: z.number().describe("The numeric value to format. Example: 1234.56"),
        country_code: z.string().describe("Two-letter country code. Example: 'PT', 'FR', 'DE'"),
        decimals: z.number().optional().describe("Number of decimal places. Defaults to 2.")
      },
      outputSchema: { original: z.number(), formatted: z.string(), locale: z.string(), country_code: z.string() },
          annotations: { title: "Format Number European Locale", readOnlyHint: true, idempotentHint: true, openWorldHint: false }
    }, async ({ number, country_code, decimals = 2 }) => {
      const localeMap = { PT:"pt-PT",ES:"es-ES",FR:"fr-FR",DE:"de-DE",IT:"it-IT",NL:"nl-NL",BE:"fr-BE",PL:"pl-PL",SE:"sv-SE",DK:"da-DK",FI:"fi-FI",AT:"de-AT",IE:"en-IE",GR:"el-GR",HU:"hu-HU",RO:"ro-RO",UK:"en-GB" };
      const locale = localeMap[country_code.toUpperCase()] || "en-GB";
      const formatted = new Intl.NumberFormat(locale, { minimumFractionDigits: decimals, maximumFractionDigits: decimals }).format(number);
      return { content: [{ type: "text", text: JSON.stringify({ original: number, formatted, locale, country_code }) }] };
    });
  • index.js:262-270 (registration)
    Registration of the 'format_number_european' tool on the MCP server via server.registerTool(), including description and input/output schemas.
    server.registerTool("format_number_european", {
      description: "Formats a number using the locale conventions of a specific European country — correct decimal and thousands separators. Returns { original, formatted, locale, country_code }. Supports PT, ES, FR, DE, IT, NL, BE, PL, SE, DK, FI, AT, IE, GR, HU, RO, UK.",
      inputSchema: {
        number: z.number().describe("The numeric value to format. Example: 1234.56"),
        country_code: z.string().describe("Two-letter country code. Example: 'PT', 'FR', 'DE'"),
        decimals: z.number().optional().describe("Number of decimal places. Defaults to 2.")
      },
      outputSchema: { original: z.number(), formatted: z.string(), locale: z.string(), country_code: z.string() },
          annotations: { title: "Format Number European Locale", readOnlyHint: true, idempotentHint: true, openWorldHint: false }
  • Input schema for format_number_european: number (required), country_code (required), decimals (optional, defaults to 2). Output schema: original, formatted, locale, country_code.
    inputSchema: {
      number: z.number().describe("The numeric value to format. Example: 1234.56"),
      country_code: z.string().describe("Two-letter country code. Example: 'PT', 'FR', 'DE'"),
      decimals: z.number().optional().describe("Number of decimal places. Defaults to 2.")
    },
  • Helper mapping of country codes to locale strings used for Intl.NumberFormat formatting.
    const localeMap = { PT:"pt-PT",ES:"es-ES",FR:"fr-FR",DE:"de-DE",IT:"it-IT",NL:"nl-NL",BE:"fr-BE",PL:"pl-PL",SE:"sv-SE",DK:"da-DK",FI:"fi-FI",AT:"de-AT",IE:"en-IE",GR:"el-GR",HU:"hu-HU",RO:"ro-RO",UK:"en-GB" };
    const locale = localeMap[country_code.toUpperCase()] || "en-GB";
Behavior4/5

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

Annotations already provide readOnly and idempotent hints. The description adds the output shape and the list of supported country codes, which are behavioral details beyond the schema and 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?

Two sentences: purpose first, then return format and supported countries. No wasted words, front-loaded with key information.

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?

Given the tool's simplicity, the description covers purpose, supported locales, and return structure. It doesn't mention error handling for unsupported codes, but output schema exists. Nearly complete.

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?

Schema coverage is 100%, but the description adds context about correct separators and a full list of supported country codes, which enhances parameter understanding beyond the schema definitions.

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 clearly states the tool formats a number using European locale conventions, with specific verb and resource. It distinguishes well from sibling tools (VAT, holidays, validation).

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?

The description implies use for formatting numbers for European countries, and the context of sibling tools clarifies when to use it. However, no explicit when-not or alternatives are given.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/josemvelez78/mcp-europe-business'

If you have feedback or need assistance with the MCP directory API, please join our Discord server