Skip to main content
Glama

set_default_currency

Set the company's default currency by providing a global currency ID. Creates the currency if needed, but fails if invoices already use it.

Instructions

Set the company default currency. POST /currencies/default. Required: currencyId (global currency ID). Creates company currency if needed. Fails if there are invoices with that currency.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
currencyIdYesGlobal currency ID (required)

Implementation Reference

  • The handler function that executes the 'set_default_currency' tool logic. It validates args with a Zod schema, then calls currencyService.setDefaultCurrency with the provided currencyId.
    async function handler(client: Client, args: Record<string, unknown> | undefined) {
      const parsed = schema.safeParse(args);
      if (!parsed.success) {
        return errorResult(parsed.error.errors.map((e) => e.message).join("; "));
      }
      return handleToolCall(() =>
        currencyService.setDefaultCurrency(client, { currencyId: parsed.data.currencyId })
      );
    }
  • Zod validation schema for set_default_currency. Requires a positive integer currencyId.
    const schema = z.object({
      currencyId: z.number().int().positive("currencyId is required (global currency ID)"),
    });
  • The tool definition/input schema for MCP (name 'set_default_currency', description, and JSON Schema inputSchema requiring a number currencyId).
    const definition = {
      name: "set_default_currency",
      description:
        "Set the company default currency. POST /currencies/default. Required: currencyId (global currency ID). Creates company currency if needed. Fails if there are invoices with that currency.",
      inputSchema: {
        type: "object" as const,
        properties: {
          currencyId: { type: "number", description: "Global currency ID (required)" },
        },
        required: ["currencyId"],
      },
    };
  • Export of the setDefaultCurrencyTool object (Tool type with definition and handler) which is imported and registered in the tools index.
    export const setDefaultCurrencyTool: Tool = {
      definition,
      handler,
    };
  • The underlying service function that makes the POST /currencies/default API call with the currencyId body.
    export async function setDefaultCurrency(
      client: Client,
      body: SetDefaultCurrencyBody
    ): Promise<unknown> {
      return client.post<unknown>("/currencies/default", body);
    }
Behavior3/5

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

With no annotations, description carries full burden. It discloses two behavioral traits: auto-creation of currency if missing, and failure condition when invoices exist. However, it does not mention other side effects (e.g., overriding previous default), authorization needs, or that it is a destructive action. Could be more comprehensive.

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?

Three sentences, no redundant words. Front-loaded with purpose. Efficiently covers key points: action, endpoint, required parameter, auto-creation, and failure condition.

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 simplicity (one parameter, no output schema), description covers essential behaviors. Missing return value details but not critical. Provides enough context for an agent to understand the core action and constraints.

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 description essentially repeats schema field definition (currencyId, global currency ID). No additional semantic detail beyond what schema provides. Baseline 3 is appropriate.

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?

Clearly states the tool sets the company default currency, with specific verb and resource. Mentions HTTP method and behavior, but could more explicitly distinguish from siblings like create_currency (which creates a currency without setting default) or update_currency (updates currency properties).

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?

Provides usage conditions: requires currencyId, creates currency if needed, fails if invoices exist. However, it does not guide when to use this tool versus alternatives (e.g., create_currency for just creating a currency, or get_default_currency for reading). No explicit when-to-use or when-not-to-use.

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/rhinosaas/rebillia-mcp-server'

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