Skip to main content
Glama

finance

Transactions: Import transactions from CSV

import_transactions
    Bulk-import transactions into one account from CSV text.

    Parity with the REST ``/api/v1/data/import_transactions/`` upload,
    adapted for a chat agent: pass the CSV as text (not a file). All rows
    are created atomically under a row lock and the account balance is
    updated in one pass.

    CSV format: a header row then ``date,description,amount,type``.
      - date: YYYY-MM-DD (also accepts MM/DD/YYYY or MM/DD/YY)
      - amount: positive number ($ and commas are stripped)
      - type: deposit/income/credit → deposit; withdrawal/expense/debit →
        withdrawal; blank → ``default_type``. (No transfers — import each
        side as a deposit/withdrawal.)
    Rows that can't be parsed are skipped and reported in ``errors``;
    valid rows still import.

    On debt accounts the deposit/withdrawal meaning is inverted (a
    ``deposit`` is a charge that increases the debt,
    a ``withdrawal`` is a payment that decreases it) — the balance math is
    identical either way. Future-dated rows are created but not applied to
    the balance until their date arrives (matching single-transaction
    creation).

    Args:
        account_id: Target account (the caller's own, active).
        csv_text: The CSV content as a string (header + rows). Max 1000
            rows per call — split larger files.
        default_type: Type for rows with a blank ``type`` column
            ("deposit" or "withdrawal", default "withdrawal").

    Returns:
        ``{"success": True, "imported_count": N, "error_count": M,
        "errors": [...up to 20...], "new_account_balance": ...,
        "account_name": ...}`` on success, or ``{"error": "..."}`` (account
        not found, empty/invalid CSV, monthly-limit exceeded, or no valid
        rows).
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
csv_textYes
account_idYes
default_typeNowithdrawal

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Goes well beyond the annotations: all rows created atomically under a row lock, balance updated in one pass, partial-success semantics (bad rows skipped and reported while valid rows still import), debt-account sign inversion, and future-dated rows not applied until their date. Failure modes (account not found, empty/invalid CSV, monthly-limit exceeded, no valid rows) are disclosed.

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?

Front-loaded with the one-line purpose before format details, and organized into CSV / behavior / Args / Returns blocks. It is long, and a couple of lines (e.g. the REST-parity note and repeated balance-math remark) could be trimmed, but nearly every sentence carries decision-relevant info.

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

Completeness5/5

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

No output schema exists, yet the description fully specifies the return envelope (success/imported_count/error_count/errors capped at 20/new_account_balance/account_name) and error shape, plus all edge-case behavior. An agent has everything needed to call and interpret it.

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

Parameters5/5

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

Schema coverage is 0%, so the description must carry the load — and it does: account_id is defined as the caller's own active account, csv_text is defined as header+rows with a 1000-row cap, and default_type is enumerated as deposit/withdrawal with its default and its role for blank type cells.

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?

States a precise verb+resource+scope: 'Bulk-import transactions into one account from CSV text.' It is clearly distinguishable from siblings like create_transaction (single), import_accounts, and parse_statement, and it names the REST endpoint it mirrors.

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?

Gives strong operational context: pass CSV as text (not a file) because it is chat-adapted, plus a hard 'Max 1000 rows per call — split larger files' constraint and a note to import transfer sides separately. It never explicitly routes the agent away from create_transaction or other import tools, so it stops short of full when/when-not guidance.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources