Skip to main content
Glama
akutishevsky

Monobank MCP Server

get_statement

Retrieve Monobank transaction statements for a specific account within a custom date range, limited to 31 days per request.

Instructions

Get Monobank statement for the time from {from} to {to} time in seconds in Unix time format. The maximum time for which it is posssible to obtain a statement is 31 days + 1 hour (2682000 seconds). The statement can be retrieved not more than once per 60 seconds, otherwise an error will be thrown.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputYes

Implementation Reference

  • The 'get_statement' tool handler registered with the MCP server. It accepts an 'account' (string), 'from' (ISO date), and optional 'to' (ISO date), validates dates, fetches bank statements from Monobank API, parses and formats the response.
    server.tool(
        "get_statement",
        "Get Monobank statement for the time from {from} to {to} time in seconds in Unix time format. The maximum time for which it is posssible to obtain a statement is 31 days + 1 hour (2682000 seconds). The statement can be retrieved not more than once per 60 seconds, otherwise an error will be thrown.",
        {
            input: z.object({
                account: z
                    .string()
                    .nonempty()
                    .describe(
                        "A unique indentificator of the Monobank account or a jar from the Statement list. If not provided, then a defaukt account is used, which is equal to '0'.",
                    ),
                from: z
                    .string()
                    .nonempty()
                    .describe("A date in ISO 8601 YYYY-MM-DD format."),
                to: z
                    .string()
                    .optional()
                    .describe("A date in ISO 8601 YYYY-MM-DD format."),
            }),
        },
        async ({ input }) => {
            try {
                const { account, from, to } = input;
    
                const dateValidation = validateStatementDates(from, to);
                if ("content" in dateValidation) {
                    return dateValidation;
                }
    
                const { fromInSeconds, toInSeconds } = dateValidation;
                const { baseUrl, monobankApiToken } = getConfig();
    
                const response = await fetchWithErrorHandling(
                    `${baseUrl}/personal/statement/${account}/${fromInSeconds}/${toInSeconds}`,
                    {
                        headers: {
                            "X-Token": monobankApiToken,
                        },
                    },
                );
    
                const data = await parseJsonResponse<StatementItem[]>(response);
                const statement = z.array(StatementItemSchema).parse(data);
                const formattedStatement = formatStatementItems(statement);
    
                return createSuccessResponse(formattedStatement);
            } catch (error) {
                return formatErrorAsToolResponse(error, "fetch statement");
            }
        },
    );
  • Zod input schema for 'get_statement' tool: account (non-empty string), from (non-empty ISO date string), and optional to (ISO date string).
    {
        input: z.object({
            account: z
                .string()
                .nonempty()
                .describe(
                    "A unique indentificator of the Monobank account or a jar from the Statement list. If not provided, then a defaukt account is used, which is equal to '0'.",
                ),
            from: z
                .string()
                .nonempty()
                .describe("A date in ISO 8601 YYYY-MM-DD format."),
            to: z
                .string()
                .optional()
                .describe("A date in ISO 8601 YYYY-MM-DD format."),
        }),
    },
  • StatementItemSchema: Zod schema defining the structure of a statement item returned from the API, used to validate API response data.
    export const StatementItemSchema = z.object({
        id: z.string(),
        time: z.number(),
        description: z.string(),
        mcc: z.number(),
        originalMcc: z.number(),
        hold: z.boolean(),
        amount: z.number().describe("Amount in cents, multiply by 100"),
        operationAmount: z.number().describe("Amount in cents, multiply by 100"),
        currencyCode: z.number(),
        commissionRate: z.number(),
        cashbackAmount: z.number().describe("Amount in cents, multiply by 100"),
        balance: z.number().describe("Amount in cents, multiply by 100"),
        comment: z.string().optional(),
        receiptId: z.string().optional(),
        invoiceId: z.string().optional(),
        counterEdrpou: z.string().optional(),
        counterIban: z.string().optional(),
        counterName: z.string().optional(),
    });
  • validateStatementDates helper: Validates ISO date strings, converts them to Unix timestamps (seconds), and enforces the maximum 31-day+1-hour range constraint.
    export function validateStatementDates(
        from: string,
        to?: string,
    ): DateValidationResult | ToolResponse {
        const fromDate = new Date(from);
        const toDate = to ? new Date(to) : new Date();
    
        if (isNaN(fromDate.getTime())) {
            return createErrorResponse(`Invalid 'from' date format: ${from}`);
        }
    
        if (to && isNaN(toDate.getTime())) {
            return createErrorResponse(`Invalid 'to' date format: ${to}`);
        }
    
        const fromInSeconds = Math.floor(fromDate.getTime() / 1000);
        const toInSeconds = Math.floor(toDate.getTime() / 1000);
    
        // Validate time range (max 31 days + 1 hour = 2682000 seconds)
        if (toInSeconds - fromInSeconds > 2682000) {
            return createErrorResponse(
                "Time range exceeds maximum allowed (31 days + 1 hour). Please use a smaller date range.",
            );
        }
    
        return { fromInSeconds, toInSeconds };
    }
  • formatStatementItems helper: Converts monetary amounts from cents to whole units by dividing amount, operationAmount, cashbackAmount, and balance by 100.
    export function formatStatementItems(items: StatementItem[]) {
        return items.map((item) => ({
            ...item,
            amount: item.amount / 100,
            operationAmount: item.operationAmount / 100,
            cashbackAmount: item.cashbackAmount / 100,
            balance: item.balance / 100,
        }));
    }
Behavior2/5

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

No annotations provided, so description must disclose all behavioral traits. It reveals time and rate limits but contradicts the schema on parameter format (Unix time vs ISO 8601), reducing trustworthiness.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Description is concise but contains conflicting information. It front-loads purpose and constraints but sacrifices accuracy.

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

Completeness2/5

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

No output schema, so description should explain return value; it does not. Contradictions in parameter format make it incomplete. Missing details on statement structure.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% per context, so description must compensate. Instead, it misrepresents parameter formats (says Unix time, schema says ISO 8601) and only partially describes account (default '0'). No value added.

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?

Description clearly identifies the tool's purpose: get a Monobank statement for a time range. However, confusion between Unix time (description) and ISO 8601 (schema) slightly diminishes clarity. Sibling tools are distinct.

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 constraints on maximum time period (31 days + 1 hour) and rate limit (once per 60 seconds), but no explicit guidance on when to use this tool versus alternatives or when not to use it.

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