Skip to main content
Glama

evm_get_portfolio_value

Calculates total EVM wallet portfolio value in USD by combining native and ERC-20 token balances, with optional token filtering.

Instructions

Calculate total portfolio value: native balance + ERC-20 tokens.

CRITICAL RULES:

  • Read-only operation

  • Requires price data for USD values

  • Native token always included

  • Optional token list for focus

PARAMETERS:

  • chain: EVM chain (required)

  • address: Wallet address (required)

  • tokenAddresses: Specific tokens (optional)

EXAMPLES: ✅ Total portfolio: {chain: "ethereum", address: "0x742d35Cc..."} ✅ Specific tokens: {chain: "polygon", address: "0x742d35Cc...", tokenAddresses: ["0xToken1...", "0xToken2..."]}

SUPPORTED EVM CHAINS (7 networks): • ethereum (Sepolia) - EIP-1559 enabled, ~12s blocks, moderate gas costs • polygon (Amoy) - Low fees, fast finality (~2s), layer 2 • avalanche (Fuji C-Chain) - Sub-second finality, dynamic fees • bsc (BNB Testnet) - 3s blocks, low gas costs, Binance ecosystem • arbitrum (Sepolia) - Optimistic rollup, low fees, Ethereum security • base (Sepolia) - Coinbase layer 2, EIP-1559, low fees • worldchain (World Sepolia) - World Network testnet, EIP-1559

CRITICAL GAS CONSIDERATIONS:

  • Ethereum: High gas costs, use gas oracle for timing

  • Polygon/BSC: Very low gas, safe for frequent transactions

  • Arbitrum/Base: L2 optimizations, ~10-50x cheaper than Ethereum

  • Avalanche: Dynamic fees, can spike during congestion

  • Always check gas price before executing transactions

TESTNET TOKENS: All chains use testnet tokens with NO REAL VALUE. Faucets available for all supported networks.

OUTPUT STRUCTURE: • totalValue: Portfolio value (USD) • nativeBalance: Native token amount • tokenBalances: ERC-20 holdings • prices: Current token prices

Running on Linux.

LINUX-SPECIFIC NOTES:

  • Package manager: apt (Ubuntu/Debian), yum (RHEL/CentOS), or pacman (Arch)

  • Python 3 is typically 'python3' command

  • GNU tools are standard

  • Use 'xdg-open' command to open files/applications

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "chain": "<chain>",
      "address": "<address>"
    },
    "name": "evm_get_portfolio_value"
  }
}

Input Schema

NameRequiredDescriptionDefault
chainYesEVM chain to query
addressYesEthereum address (0x...)
tokenAddressesNoOptional: Array of ERC-20 token contract addresses to include

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.6/5.0
Behavior4/5

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

With no annotations supplied, the description carries the full burden and does disclose the key traits: read-only operation, dependency on price data for USD values, native token always included, and that all chains are testnets with no real value. It also gives an OUTPUT STRUCTURE (totalValue, nativeBalance, tokenBalances, prices). The long gas-strategy and Linux/package-manager sections are irrelevant to a read-only valuation call and dilute the behavioral signal.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The core is front-loaded and readable, but the bulk of the text is unrelated filler: gas cost strategy for seven networks, testnet faucet notes, a chain directory duplicating the enum, and a Linux package-manager/how-to-open-files section that has nothing to do with portfolio valuation. Far more text than the tool needs.

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?

For a 3-parameter read-only valuation tool with no output schema, the description covers purpose, parameter behavior, worked examples, and a return-value breakdown, which is enough to invoke it correctly. The supported-chain listing duplicates the enum and the appended Linux notes are off-topic, but nothing an agent needs to call the tool is missing.

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%, so baseline is 3; the description adds real meaning beyond the schema by stating the default scope (native token always included) and that tokenAddresses merely focuses the result rather than replacing the base behavior. The examples demonstrate the array-of-addresses usage concretely.

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?

Opening line gives a specific verb and resource: "Calculate total portfolio value: native balance + ERC-20 tokens," which clearly distinguishes an aggregate valuation from the single-asset sibling evm_get_balance. It stops short of naming any sibling or stating the contrast explicitly, so differentiation is inferable rather than stated.

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?

Two worked examples (full portfolio vs. specific tokens) show when to pass tokenAddresses, and "Optional token list for focus" hints at narrowing scope. There is no explicit when-not guidance, no mention of evm_get_balance or evm_get_account_analytics as alternatives, and no stated prerequisites such as price-feed availability.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools