Skip to main content
Glama

get_portfolio_diff

Read-onlyIdempotent

Decompose portfolio value changes over a time window, breaking down USD change into price moves, net deposits/withdrawals, and other effects across chains. Get both structured data and a narrative summary.

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?

Adds significant behavioral context beyond annotations: v1 caveats including history fetcher caps (50 items), truncation flag, DeFi interest in residual, Solana tx skipping, Bitcoin limitations. Annotations only indicate read-only/idempotent; description enriches agent understanding of limitations.

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 long but well-structured: front-loaded main purpose, then output breakdown, address/window info, sibling differentiation, caveats. Every sentence adds value; minor trimming could improve conciseness without losing information.

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?

No output schema, but description explains return format (structured + narrative) and breakdown components. Includes important caveats and truncation. Lacks exact field names in structured envelope, but sufficient for agent to infer behavior.

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 descriptions. The tool description adds extra meaning: wallet parameter lists chains, window explains rolling vs ytd and truncation, format clarifies agent usage. Enhances schema with operational context.

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 user portfolio changes over a time window, specifying output components (price moves, net deposits/withdrawals, other) and explicitly distinguishes from siblings `get_portfolio_summary` and `get_pnl_summary`. The purpose is highly specific and unambiguous.

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?

Provides clear context for when to use (narrative decomposition) and differentiates from related tools. Mentions required at least one address and window options. Does not explicitly state exclusions but gives sufficient guidance for typical use.

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/vaultpilot-mcp'

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