Skip to main content
Glama

Tokenbooks - crypto and fiat accounting and payments

Get Cost-Basis Lot Ledger

get_lot_ledger
Read-onlyIdempotent

Trace paginated cost-basis acquisition, disposal, transfer, and adjustment history across a portfolio, optionally narrowed by asset, wallet, event kind, accounting transaction, or date.

Input Schema

NameRequiredDescriptionDefault
pageNoPage number, starting at 1
sortNoSingle public sort field. Prefix with - for descending. Supported fields: timestamp, diff, value, price
limitNoMaximum items to return, maximum 100. Preferred MCP pagination field.
filterNoPublic AIP-160 filter string. Supported fields: id lot identifier (=, !=, in, not in), entry_id ledger-row identifier (=, !=, in, not in), asset_id (=, !=, in, not in), asset_spam (= true or false), entry_kind (=, !=, in, not in), wallet (=, !=, in, not in using chainId:address), portfolio_transaction_id (=, !=, in, not in), timestamp (=, !=, >, >=, <, <= with ISO datetimes). The asset display name is not filterable.
toDateNoOptional ISO timestamp upper bound
chainIdNoExact chain ID when filtering to one wallet; requires walletAddress
assetRefNoDeprecated compatibility selector for asset symbol or asset id. Prefer filter=asset_id.
fromDateNoOptional ISO timestamp lower bound
pageSizeNoDeprecated alias for limit, maximum 100. Prefer limit for new MCP calls.
entryKindNoFilter by lot entry kind (any of)
portfolioRefYesPortfolio exact name or slug
workspaceRefYesWorkspace exact name or slug
walletAddressNoExact case-sensitive wallet address when filtering to one wallet; requires chainId

Output Schema

NameRequiredDescriptionDefault
dataYes
paginationYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / properties / data / items / properties / operationType / enum
      Previous value: -[
      -  "DEPOSIT_FIAT",
      -  "INCOME",
      -  "REFUND",
      -  "WITHDRAWAL_FIAT",
      -  "EXPENSE",
      -  "BUY",
      -  "SELL",
      -  "EXCHANGE",
      -  "SWAP",
      -  "MOVE",
      -  "INTERCOMPANY_SEND",
      -  "INTERCOMPANY_RECEIVE",
      -  "STAKE",
      -  "UNSTAKE",
      -  "PROTOCOL_DEPOSIT",
      -  "PROTOCOL_WITHDRAW",
      -  "VAULT_DEPOSIT",
      -  "VAULT_WITHDRAW",
      -  "LP_IN",
      -  "LP_OUT",
      -  "LOAN_BORROW",
      -  "LOAN_REPAY",
      -  "LOAN_LIQUIDATION",
      -  "LEND_GIVE",
      -  "LEND_WITHDRAW",
      -  "ADJUSTMENT",
      -  "UNCATEGORIZED",
      -  "SPAM"
      -]New value: +[
      +  "DEPOSIT_FIAT",
      +  "INCOME",
      +  "REFUND",
      +  "REBATE",
      +  "WITHDRAWAL_FIAT",
      +  "EXPENSE",
      +  "BUY",
      +  "SELL",
      +  "EXCHANGE",
      +  "SWAP",
      +  "MOVE",
      +  "INTERCOMPANY_SEND",
      +  "INTERCOMPANY_RECEIVE",
      +  "STAKE",
      +  "UNSTAKE",
      +  "PROTOCOL_DEPOSIT",
      +  "PROTOCOL_WITHDRAW",
      +  "VAULT_DEPOSIT",
      +  "VAULT_WITHDRAW",
      +  "LP_IN",
      +  "LP_OUT",
      +  "LOAN_BORROW",
      +  "LOAN_REPAY",
      +  "LOAN_LIQUIDATION",
      +  "LEND_GIVE",
      +  "LEND_WITHDRAW",
      +  "ADJUSTMENT",
      +  "UNCATEGORIZED",
      +  "SPAM"
      +]
  2. Changed1 schema field changed
    • removedOutput schema / $schema
      Removed value: -"https://json-schema.org/draft/2020-12/schema"
  3. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "https://json-schema.org/draft/2020-12/schema",
      +  "additionalProperties": false,
      +  "properties": {
      +    "data": {
      +      "items": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "acquisitionTimestamp": {
      +            "type": "string"
      +          },
      +          "assetId": {
      +            "type": "string"
      +          },
      +          "assetIsSpam": {
      +            "type": "boolean"
      +          },
      +          "assetName": {
      +            "type": "string"
      +          },
      +          "assetSymbol": {
      +            "type": "string"
      +          },
      +          "diff": {
      +            "type": "string"
      +          },
      +          "entryId": {
      +            "type": "string"
      +          },
      +          "entryKind": {
      +            "enum": [
      +              "ADD",
      +              "DSP",
      +              "CUT",
      +              "MVE",
      +              "RES",
      +              "REL"
      +            ],
      +            "type": "string"
      +          },
      +          "id": {
      +            "type": "string"
      +          },
      +          "lotMethod": {
      +            "type": "string"
      +          },
      +          "operationType": {
      +            "enum": [
      +              "DEPOSIT_FIAT",
      +              "INCOME",
      +              "REFUND",
      +              "WITHDRAWAL_FIAT",
      +              "EXPENSE",
      +              "BUY",
      +              "SELL",
      +              "EXCHANGE",
      +              "SWAP",
      +              "MOVE",
      +              "INTERCOMPANY_SEND",
      +              "INTERCOMPANY_RECEIVE",
      +              "STAKE",
      +              "UNSTAKE",
      +              "PROTOCOL_DEPOSIT",
      +              "PROTOCOL_WITHDRAW",
      +              "VAULT_DEPOSIT",
      +              "VAULT_WITHDRAW",
      +              "LP_IN",
      +              "LP_OUT",
      +              "LOAN_BORROW",
      +              "LOAN_REPAY",
      +              "LOAN_LIQUIDATION",
      +              "LEND_GIVE",
      +              "LEND_WITHDRAW",
      +              "ADJUSTMENT",
      +              "UNCATEGORIZED",
      +              "SPAM"
      +            ],
      +            "type": "string"
      +          },
      +          "portfolioTransactionId": {
      +            "type": "string"
      +          },
      +          "positionId": {
      +            "type": "string"
      +          },
      +          "price": {
      +            "type": "string"
      +          },
      +          "timestamp": {
      +            "type": "string"
      +          },
      +          "txHash": {
      +            "minLength": 1,
      +            "type": "string"
      +          },
      +          "value": {
      +            "type": "string"
      +          },
      +          "walletAddress": {
      +            "type": "string"
      +          },
      +          "walletChainId": {
      +            "type": "string"
      +          },
      +          "walletName": {
      +            "type": "string"
      +          },
      +          "walletTransactionTransfers": {
      +            "items": {
      +              "additionalProperties": false,
      +              "properties": {
      +                "chainId": {
      +                  "type": "string"
      +                },
      +                "txHash": {
      +                  "minLength": 1,
      +                  "type": "string"
      +                }
      +              },
      +              "required": [
      +                "chainId",
      +                "txHash"
      +              ],
      +              "type": "object"
      +            },
      +            "type": "array"
      +          }
      +        },
      +        "required": [
      +          "id",
      +          "entryId",
      +          "timestamp",
      +          "acquisitionTimestamp",
      +          "entryKind",
      +          "lotMethod",
      +          "diff",
      +          "value",
      +          "assetId",
      +          "assetIsSpam",
      +          "portfolioTransactionId",
      +          "walletTransactionTransfers"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "pagination": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "page": {
      +          "maximum": 9007199254740991,
      +          "minimum": -9007199254740991,
      +          "type": "integer"
      +        },
      +        "pageSize": {
      +          "maximum": 9007199254740991,
      +          "minimum": -9007199254740991,
      +          "type": "integer"
      +        },
      +        "totalCount": {
      +          "maximum": 9007199254740991,
      +          "minimum": -9007199254740991,
      +          "type": "integer"
      +        },
      +        "totalPages": {
      +          "maximum": 9007199254740991,
      +          "minimum": -9007199254740991,
      +          "type": "integer"
      +        }
      +      },
      +      "required": [
      +        "page",
      +        "pageSize",
      +        "totalCount",
      +        "totalPages"
      +      ],
      +      "type": "object"
      +    }
      +  },
      +  "required": [
      +    "data",
      +    "pagination"
      +  ],
      +  "type": "object"
      +}
  4. First observed

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, and non-destructive behavior, so the description need not restate safety. It usefully adds that results are 'paginated,' a trait not in the annotations, but omits any auth, rate-limit, or result-shape context. Adequate under the lower bar set by the annotations.

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?

A single sentence that front-loads the core action and appends the narrowing dimensions. No filler, no redundancy with the title or schema.

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?

An output schema exists, so return values need no explanation, and the schema fully documents pagination, sorting, and filter syntax. The description covers the conceptual axes an agent needs. Only a small gap remains in not distinguishing this from sibling history/ledger tools.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents all 13 parameters in detail (filter syntax, deprecated aliases, sort fields, chainId/walletAddress pairing). The description's enumeration of narrowing axes loosely mirrors those fields but adds no syntax or constraint detail beyond the schema. Baseline 3 is correct.

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?

States a specific verb (trace) and resource (cost-basis acquisition/disposal/transfer/adjustment ledger history) scoped to a portfolio. An agent can distinguish it from get_journal_entry or list_portfolio_transactions by the 'cost-basis lot' framing, though no sibling is named explicitly.

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?

The phrase 'optionally narrowed by asset, wallet, event kind, accounting transaction, or date' implies the tool is a filtered history query, but there is no when-to-use guidance and no mention of when to prefer a sibling like get_journal_entry or get_asset_position. Usage is inferable but not stated.

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