Skip to main content
Glama

Tokenbooks - crypto and fiat accounting and payments

Merge Portfolio Transactions

merge_transactions
Destructive

Destructively combine wallet movements from several accounting transactions into one target transaction and reclassify it; preview the grouping first, then track the queued requestId.

Input Schema

NameRequiredDescriptionDefault
reasonNoOptional immutable root reason. Nonempty bytes are preserved exactly; use ptx:<uuid> for transaction references.
subTypeNoOptional operation sub-type
operationsYesOperations to merge into the target
portfolioRefYesPortfolio exact name or slug
workspaceRefYesWorkspace exact name or slug
operationTypeYesAccounting operation type for the merged transaction
transactionIdYesTarget transaction the operations are merged into

Output Schema

NameRequiredDescriptionDefault
errorNo
statusYes
successNo
requestIdNo
transactionIdYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / 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
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "https://json-schema.org/draft/2020-12/schema",
      +  "additionalProperties": false,
      +  "oneOf": [
      +    {
      +      "additionalProperties": false,
      +      "properties": {
      +        "requestId": {
      +          "type": "string"
      +        },
      +        "status": {
      +          "const": "queued",
      +          "type": "string"
      +        },
      +        "transactionId": {
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "status",
      +        "requestId",
      +        "transactionId"
      +      ],
      +      "type": "object"
      +    },
      +    {
      +      "additionalProperties": false,
      +      "properties": {
      +        "error": {
      +          "additionalProperties": false,
      +          "properties": {
      +            "message": {
      +              "type": "string"
      +            },
      +            "name": {
      +              "type": "string"
      +            }
      +          },
      +          "required": [
      +            "name",
      +            "message"
      +          ],
      +          "type": "object"
      +        },
      +        "status": {
      +          "const": "completed",
      +          "type": "string"
      +        },
      +        "success": {
      +          "type": "boolean"
      +        },
      +        "transactionId": {
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "status",
      +        "success",
      +        "transactionId"
      +      ],
      +      "type": "object"
      +    }
      +  ],
      +  "properties": {
      +    "error": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "message": {
      +          "type": "string"
      +        },
      +        "name": {
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "name",
      +        "message"
      +      ],
      +      "type": "object"
      +    },
      +    "requestId": {
      +      "type": "string"
      +    },
      +    "status": {
      +      "enum": [
      +        "queued",
      +        "completed"
      +      ],
      +      "type": "string"
      +    },
      +    "success": {
      +      "type": "boolean"
      +    },
      +    "transactionId": {
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "status",
      +    "transactionId"
      +  ],
      +  "type": "object"
      +}
  3. First observed

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true, idempotentHint=false and openWorldHint=true, so 'destructively combine' is redundant. The genuine added value is that the call is queued/asynchronous and returns a requestId, and that a preview step is expected before committing – neither of which appears in 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?

One tight sentence with a semicolon; the destructive nature and the target-transaction semantics are front-loaded, and the workflow guidance follows without any filler.

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 not be described, and the description still supplies the pieces the schema cannot: destructive scope, async queued execution, and the preview-then-track workflow. Only the identity of the preview/status companions is left implicit.

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% and includes a documented nested operations array and an enum, so the schema already carries the parameter burden. The description adds no syntax, ordering, or field-level meaning beyond what is documented in the schema.

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 precise verb+resource ('combine wallet movements from several accounting transactions into one target transaction') plus the reclassification effect, which clearly differentiates the direction of the operation from the split sibling. It never names an actual sibling tool, so the differentiation is inferential rather than explicit.

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 an ordered workflow: 'preview the grouping first, then track the queued requestId', which tells the agent to run a preview step and to follow up via request-status polling. It stops short of naming the preview or status tools, and offers no explicit when-not-to-use 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