Skip to main content
Glama

update_currency

Update a company currency by specifying the conversion rate and fixed rate flag.

Instructions

Update a company currency. PUT /currencies/{companyCurrencyId}. Required: companyCurrencyId, conversionRate, fixedRate.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
companyCurrencyIdYesCompany currency ID (required)
conversionRateYesConversion rate (required)
fixedRateYesFixed rate flag (required)

Implementation Reference

  • Handler function for the update_currency tool. Parses arguments with Zod (companyCurrencyId, conversionRate, fixedRate), then calls currencyService.updateCurrency to perform the PUT /currencies/{companyCurrencyId} API request.
    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("; "));
      }
      const { companyCurrencyId, conversionRate, fixedRate } = parsed.data;
      return handleToolCall(() =>
        currencyService.updateCurrency(client, companyCurrencyId, { conversionRate, fixedRate })
      );
    }
  • Zod schema (lines 7-11) and MCP inputSchema definition (lines 13-26) for update_currency tool. Requires companyCurrencyId (string), conversionRate (number), fixedRate (boolean).
    const schema = z.object({
      companyCurrencyId: z.string().min(1, "companyCurrencyId is required"),
      conversionRate: z.number().finite("conversionRate is required"),
      fixedRate: z.boolean({ required_error: "fixedRate is required (boolean)" }),
    });
    
    const definition = {
      name: "update_currency",
      description:
        "Update a company currency. PUT /currencies/{companyCurrencyId}. Required: companyCurrencyId, conversionRate, fixedRate.",
      inputSchema: {
        type: "object" as const,
        properties: {
          companyCurrencyId: { type: "string", description: "Company currency ID (required)" },
          conversionRate: { type: "number", description: "Conversion rate (required)" },
          fixedRate: { type: "boolean", description: "Fixed rate flag (required)" },
        },
        required: ["companyCurrencyId", "conversionRate", "fixedRate"],
      },
    };
  • Exports updateCurrencyTool as a Tool object pairing the definition (name/description/inputSchema) with the handler function. This is registered into the tool list via registerCurrencyTools() in the currencies index.
    export const updateCurrencyTool: Tool = {
      definition,
      handler,
    };
  • The underlying API service function updateCurrency that performs the actual HTTP PUT request to /currencies/{companyCurrencyId} with the provided body (conversionRate, fixedRate).
    /** PUT /currencies/{companyCurrencyId} */
    export async function updateCurrency(
      client: Client,
      companyCurrencyId: string,
      body: UpdateCurrencyBody
    ): Promise<unknown> {
      return client.put<unknown>(`/currencies/${companyCurrencyId}`, body);
    }
  • UpdateCurrencyBody interface defining the shape of the request body: conversionRate (number) and fixedRate (boolean).
    /** Update body. Aligned with CurrencyService::updateCompanyCurrency: conversionRate, fixedRate required. */
    export interface UpdateCurrencyBody {
Behavior2/5

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

No annotations are provided, so the description carries full burden. It only states the HTTP method (PUT) and required fields, but does not disclose behavioral traits such as idempotency, side effects (e.g., if updating default currency impacts other entities), authorization requirements, or error states.

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?

Single sentence plus a list of required fields; no wasted words. The key action 'Update' is front-loaded. Could be slightly more structured (e.g., separate sections), but it's efficient and clear.

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

Completeness3/5

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

No output schema exists, so description should explain return values or outcomes. It does not mention what the response is (e.g., updated currency object or success status), nor prerequisites (e.g., currency must exist). For a 3-parameter update tool with no output schema, this is moderately complete but has gaps.

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% with each parameter described in the schema. The description merely reiterates the required parameters without adding new meaning or constraints (e.g., allowed ranges for conversionRate). Baseline is 3 due to high schema coverage, and no additional semantics are provided.

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 'Update a company currency', specifying the verb and resource. It distinguishes from siblings like create_currency, delete_currency, get_currency, and list_currencies by using 'Update' which uniquely identifies this tool's action.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

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

No guidance on when to use vs alternatives. It lists required parameters but does not specify when not to use this tool (e.g., if currency is locked or default), nor does it mention alternatives like set_default_currency for changing default.

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