Skip to main content
Glama

add_txn

Add single or bulk financial transactions (buy, sell, deposit, dividend, tax) with automatic currency conversion and reason capture for investment thesis tracking.

Instructions

Insert one or more transactions in a single call. transactions is an array — pass one entry for a single trade, many for a CSV / brokerage export / paste import. Rows are sorted by date ascending before insertion (average cost depends on insertion order). For bulk imports: first show the user your detected column mapping and total row count, wait for their confirmation, then call this once with all rows. Types: buy/sell move shares; deposit adds shares (set price=0 for grants/transfers, or actual cost basis); dividend/tax record cash events (price = total amount, shares = 1).

Reason capture (critical for thesis tracking): For NEW buy/sell trades — not historical bulk imports — the reason field is the single highest-leverage input you can capture for the user's long-term self-feedback loop (powers show_thesis_track later). When the user logs a NEW single buy/sell without supplying a reason, ALWAYS ask before calling: "What's your reason for this trade? Even one short sentence — 'earnings beat thesis', 'rebalancing toward defensive', 'avg-down on dip' — is enough." Then include their answer in reason. Skip the ask only when (a) the user is explicitly migrating historical data, or (b) the trade type is deposit/dividend/tax (no investment decision).

Each row carries its own asset_type (default 'stock'), which splits two flows:

  • stock: price is in the market's native currency (US→USD, KRX/KOSDAQ→KRW, JP→JPY, HK→HKD, LSE→GBP, XETRA→EUR, NSE→INR, TW→TWD) — market determines it, the currency param is ignored. Non-US holdings must set market to the listing exchange; ticker stays the bare local code (e.g. market: "KRX", ticker: "005930").

  • crypto / commodity / real_estate / other: there is no market or price provider — these are priced manually (not auto-synced). market is ignored and stored null, ticker is a free-form name (e.g. "Bitcoin", "Seoul apartment"), and price is in the currency param (default USD).

In both cases price is converted to USD at the transaction date before storing — every stored price is USD.

A single-entry call returns the inserted transaction; a multi-entry call returns a per-ticker / per-type summary.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
transactionsYesOne or more transactions to insert
Behavior5/5

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

No annotations are provided, so the description fully bears the transparency burden. It discloses critical behaviors: rows sorted by date ascending, price conversion to USD, asset-type-specific handling (stock vs non-stock), ignoring currency for stocks, and the different return formats for single vs multi-entry calls. This is comprehensive and leaves little ambiguity.

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?

The description is relatively long but well-organized, with clear sections and front-loaded core action. Every sentence adds value given the tool's complexity. It could be slightly more concise, but the structured presentation (type-specific details, reason capture guidelines) justifies the length. Score 4 for being slightly verbose but highly efficient in content.

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?

Given the tool's complexity (multiple transaction types, asset classes, markets, currencies) and absence of an output schema, the description is remarkably complete. It covers the full behavioral model: asset-type flow splits, currency conversion rules, reason capture protocols, and return format. No notable gaps remain for an agent to infer.

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?

While the input schema already has 100% coverage of parameters, the description enriches meaning far beyond the schema descriptions. For example, it explains the semantic difference between 'buy/sell' and 'deposit/dividend/tax', clarifies the interplay between 'market' and 'currency', and provides detailed guidance on the 'reason' parameter's importance for thesis tracking. This significantly aids correct parameter usage.

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 'Insert one or more transactions in a single call', specifying the verb (insert) and resource (transactions). It goes beyond a simple statement by explaining the array structure and common use cases (single trade vs bulk import), effectively distinguishing this tool from sibling tools like delete_txn or edit_txn.

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

Usage Guidelines5/5

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

The description provides explicit when-to-use and when-to-avoid guidance. It details the bulk import workflow (show mapping, wait for confirmation), and specifies when to ask for the 'reason' field (new buy/sell trades) versus skip (historical data or non-buy/sell types). This level of procedural instruction is exemplary.

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/evan-moon/firma'

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