Skip to main content
Glama

get_portfolio_diff

Read-onlyIdempotent

Decompose portfolio changes over a time window into price impact, net flows, and residual effects, broken down by chain and asset.

Instructions

Decompose what changed in the user's portfolio over a time window — the AI version of an account statement. Returns the top-level USD change, broken down by chain and per-asset into: price moves (USD impact of price change on what was held the entire window), net deposits / withdrawals (sum of priced external transfers), and 'other' (the residual — interest accrual, swap legs, MEV, anything not cleanly attributable to price or external flow). Supports wallet (EVM), tronAddress, solanaAddress, bitcoinAddress — at least one required. Window: 24h / 7d / 30d / ytd. Returns BOTH a structured envelope AND a pre-rendered narrative string suitable for verbatim relay (control via format). Distinct from get_portfolio_summary (which gives current state) and get_pnl_summary (which gives the single net-PnL number) — this tool gives narrative decomposition. v1 caveats: history fetcher caps at ~50 items per chain, so very active wallets may under-count flows (response surfaces truncated: true); DeFi-position interest accrual collapses into the otherEffectUsd residual rather than its own bucket; Solana program-interaction txs (Jupiter swaps, MarginFi actions, etc.) are skipped from net-flow accounting (their balance deltas mix swap legs); Bitcoin shows current balance only (no in-window flow accounting yet).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
walletNoEVM wallet (Ethereum / Arbitrum / Polygon / Base / Optimism). Used to fetch current balances and walk EVM tx history for the window.
tronAddressNoTRON mainnet base58 address (T-prefix). Folds TRX + TRC-20 balances and TRON history into the diff.
solanaAddressNoSolana mainnet base58 pubkey. Folds SOL + SPL balances and Solana history into the diff.
bitcoinAddressNoBitcoin address (any type). Folds BTC balance + history. Only one BTC address per call in v1.
windowNoTime window for the diff. "24h" / "7d" / "30d" are rolling; "ytd" is calendar-year-to-date (UTC). For periods longer than 30d the underlying history fetcher's per-chain item cap (~50) may truncate flow accounting; the response surfaces `truncated: true` when this happens.30d
formatNo"structured" returns the JSON envelope only. "narrative" returns only the pre-rendered string. "both" (default) returns both — agents typically use the narrative for verbatim relay and the structured for follow-up questions.both
Behavior5/5

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

Annotations indicate read-only, safe behavior. Description adds extensive behavioral detail: breakdown into price moves, deposits/withdrawals, other; v1 caveats about truncation, interest accrual handling, Solana exclusions, Bitcoin limitations. No contradiction.

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?

Description is front-loaded with purpose, then details parameters and caveats. Long but every sentence adds value. Could be slightly more concise, but acceptable for complexity.

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?

Comprehensive given no output schema: explains return structure, parameter behavior, and limitations convincingly. Covers all necessary context for agent to use correctly.

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

Parameters4/5

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

Schema coverage is 100% with good descriptions. Description adds extra context like 'at least one required', window rolling vs calendar, and format parameter purpose. Adds moderate value beyond schema.

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 it decomposes portfolio changes over time, specifies verb 'decompose' and resource 'portfolio changes', and explicitly distinguishes from siblings (get_portfolio_summary and get_pnl_summary).

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?

Provides explicit when-to-use guidance: explains supported address types, window options, format control, and caveats about truncation. Differentiates from siblings, helping agent choose correctly.

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/szhygulin/recon-crypto-mcp'

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