Skip to main content
Glama

Build Lots

build_lots
Read-onlyIdempotent

Build the lot inventory per account and every disposal with basis, gain and holding period. PREMIUM (license).

Methods: fifo (the default rule when no specific identification is made, Treas. Reg. 1.1012-1(j)), lifo, hifo, or specific_id via a row's specific_lots {lot_id: qty}. Typical input {"ledger": , "method": "hifo", "transfers": } returns {"disposals": [{"row": "cb9", "asset": "BTC", "qty": "0.5", "proceeds": "31000.00", "basis": "20000.00", "gain": "11000.00", "term": "long", ...}], "open_lots": [...], "summary": {"short_term": {...}, "long_term": {...}}}. Fees: a cash purchase's fee joins basis; a sale's or exchange's fee reduces the amount realized (1.1001-7); a network fee paid in the transferred asset is a disposal of those units (transfer_fee_policy dispose) unless you choose ignore. Transfers between your own accounts move lots with their basis and acquisition date. Use once ledger_lint reports no errors. Not tax advice: it applies the stated rules to your rows and shows its work. Errors: on invalid, missing, or malformed input this tool never raises a protocol error — it returns {"error": ""} (for example {"error": "method must be fifo, lifo, hifo or specific_id"}). Every call is read-only and idempotent, so after correcting the input it is always safe to retry.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ledgerYescanonical rows.
methodNofifo, lifo, hifo or specific_id (rows without specific_lots fall back to fifo).fifo
tax_yearNowhen set, only disposals in that calendar year are returned (the inventory still runs from the start).
transfersNopairs from match_transfers ({"out": id, "in": id, ...}); empty to auto-match with the defaults.
on_missing_lotsNoerror (default), or zero_basis for lenient mode - disposals beyond the lots held get zero basis and unmatched transfer_out rows simply leave the inventory, each flagged.error
transfer_fee_policyNodispose (default) or ignore for network fees paid in the transferred asset.dispose

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

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

The description goes well beyond the annotations by disclosing exact error behavior ('never raises a protocol error — it returns {"error": ...}'), detailed fee handling rules, transfer treatment, and the read-only/idempotent retry guarantee. These behavioral details add substantial operational context that annotations alone do not provide.

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 front-loaded with the purpose and organized into clear sections for methods, fees, transfers, usage timing, and errors. It is long, with an extended example and legal disclaimers, but each section contributes meaningful information, so it remains purposeful rather than bloated.

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 tax-calculation complexity, the description covers everything needed: preconditions, all method options, fee policies, transfer behavior, error semantics, and output structure. An output schema exists, so the example return shape is a bonus rather than a requirement, making the definition fully complete.

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?

Although schema coverage is 100%, the description adds rich meaning: tax regulation citations for fifo, the specific_id fallback rule, fee basis treatment, transfer_fee_policy semantics, and a concrete input/output example. This is far beyond what the schema properties describe.

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 opens with a specific verb-resource pair: 'Build the lot inventory per account and every disposal with basis, gain and holding period.' This clearly states the tool's unique role among siblings and distinguishes it from validation (ledger_lint), transfer matching (match_transfers), and reporting (form_8949_rows).

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?

It gives an explicit precondition: 'Use once ledger_lint reports no errors,' and references match_transfers output as input, clarifying sequencing and data flow. However, it does not explicitly list when not to use this tool or name alternatives for the same task, so it falls short of a full 5.

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.

TDQS

A4.6/5.0
Disambiguation5/5

Each of the eight tools targets a distinct stage or analysis: import normalization, ledger validation, transfer pairing, lot building, Form 8949 formatting, broker-form reconciliation, wash-sale checking, and LP math. No two tools could be reasonably confused for one another.

Naming Consistency3/5

Names are all lowercase snake_case and readable, but they mix verb_object forms like parse_transactions, match_transfers, and build_lots with noun-first compound forms like ledger_lint, lp_position_math, and wash_window_check. The convention is not uniform enough to be 'mostly consistent,' though it is still predictable from the domain.

Tool Count5/5

Eight tools is a well-scoped size for a crypto tax-lot workflow; each tool covers a necessary step without redundant helpers. The count feels neither thin nor bloated.

Completeness5/5

The toolset covers the full pipeline from transaction import through linting, transfer matching, lot building, tax form row generation, 1099-DA reconciliation, and wash-sale review. The standalone LP math tool addresses a relevant adjacent need, and there are no obvious dead ends.

Resources