Skip to main content
Glama
akutishevsky

Monobank MCP Server

get_currency_rates

Retrieve currency exchange rates from Monobank with a five-minute refresh interval.

Instructions

Get a basic list of currency rates from Monobank. The information can be refreshed once per 5 minutes, otherwise an error will be thrown.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • src/index.ts:22-39 (registration)
    The 'get_currency_rates' tool is registered on the MCP server using server.tool(). The handler is inline: it calls the Monobank /bank/currency endpoint, parses the JSON response, validates it against CurrencyRatesResponseSchema, and returns the result via createSuccessResponse.
    server.tool(
        "get_currency_rates",
        "Get a basic list of currency rates from Monobank. The information can be refreshed once per 5 minutes, otherwise an error will be thrown.",
        {},
        async () => {
            try {
                const { baseUrl } = getConfig();
                const response = await fetchWithErrorHandling(
                    `${baseUrl}/bank/currency`,
                );
                const result = await parseJsonResponse<CurrencyRate[]>(response);
                const currencyRates = CurrencyRatesResponseSchema.parse(result);
                return createSuccessResponse(currencyRates);
            } catch (error) {
                return formatErrorAsToolResponse(error, "get currency rates");
            }
        },
    );
  • Defines CurrencyRateSchema (zod object with fields: currencyCodeA, currencyCodeB, date, rateBuy?, rateSell?, rateCross?) and CurrencyRatesResponseSchema (z.array of CurrencyRateSchema) used to validate the currency rates API response.
    import { z } from "zod";
    
    export const CurrencyRateSchema = z.object({
        currencyCodeA: z.number(),
        currencyCodeB: z.number(),
        date: z.number(),
        rateBuy: z.number().optional(),
        rateSell: z.number().optional(),
        rateCross: z.number().optional(),
    });
    
    export const CurrencyRatesResponseSchema = z.array(CurrencyRateSchema);
  • Defines the CurrencyRate TypeScript interface used for typing the parsed JSON response from the /bank/currency endpoint.
    export interface CurrencyRate {
        currencyCodeA: number;
        currencyCodeB: number;
        date: number;
        rateBuy?: number;
        rateSell?: number;
        rateCross?: number;
    }
  • fetchWithErrorHandling helper used to make the HTTP request to the /bank/currency endpoint.
    export async function fetchWithErrorHandling(
        url: string,
        options?: RequestInit,
    ): Promise<Response> {
        const response = await fetch(url, options);
    
        if (!response.ok) {
            const errorText = await response
                .text()
                .catch(() => response.statusText);
            throw new Error(`HTTP ${response.status} - ${errorText}`);
        }
    
        return response;
    }
  • parseJsonResponse helper used to parse the JSON body of the /bank/currency response.
    export async function parseJsonResponse<T>(response: Response): Promise<T> {
        try {
            return await response.json();
        } catch (error) {
            throw new Error(
                `Failed to parse response as JSON: ${
                    error instanceof Error ? error.message : "Unknown JSON error"
                }`,
            );
        }
    }
Behavior4/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 discloses the rate limit and error condition, which is important behavioral information. However, it does not detail the return format or other behaviors, so a 4 is given.

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, front-loaded with purpose, then constraint. No unnecessary words. Every sentence earns its place.

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 simplicity (no params, no output schema), the description covers the source and a key constraint. It might lack details on the return structure, but for a basic list retrieval, it is sufficiently 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?

The schema has zero parameters, making schema coverage 100%. The description adds no parameter semantics because none are needed. The baseline for 0 parameters is 4, and the description meets that.

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 verb 'Get' and the resource 'a basic list of currency rates from Monobank', distinguishing it from sibling tools like get_client_info and get_statement which serve different purposes.

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 explicitly mentions the refresh rate constraint: 'once per 5 minutes, otherwise an error will be thrown', providing clear guidance on when to use the tool. However, it does not mention alternatives or explicitly state when not to use it, so a 4 is appropriate.

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/akutishevsky/monobank-mcp-server'

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