Skip to main content
Glama
Derive MCP Server

Derive MCP Server

by yashhsm

get_portfolio_summary

Retrieve a complete portfolio overview in one call, including USDC balance, positions with greeks, and aggregate totals, so you can avoid separate collateral and positions queries.

Instructions

Get a complete portfolio overview in a single call: USDC balance, all positions with greeks, and aggregate totals. Returns {balance, positions: [...], totals: {value, unrealized_pnl, delta, gamma, vega, theta}}. Use this INSTEAD of calling get_collaterals + get_positions separately — saves a tool call and does the aggregation for you. IMPORTANT: totals.delta is summed across ALL currencies (BTC + ETH + SOL + HYPE). For hedging a specific currency, filter positions by currency prefix (e.g., instrument.startsWith('ETH')) and sum their deltas. NOTE: positions include mark_price but NOT bid/ask. To close options, use get_tickers(expiry) for real MM quotes. Theta values are in USD/day for the full position size (already scaled by amount).

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "get_portfolio_summary"
  }
}

Input Schema

NameRequiredDescriptionDefault
subaccount_idNoSubaccount ID (defaults to configured)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.6/5.0
Behavior5/5

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

No annotations are supplied, so the description carries the full burden and does so: it names the return shape, discloses that totals.delta is summed across ALL currencies, warns that positions carry mark_price but not bid/ask, and specifies theta units (USD/day, pre-scaled by amount). These are exactly the non-obvious traits that cause miscomputation if unstated.

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?

Front-loaded with the payoff and return shape, then progressively narrower caveats, so an agent can stop reading early and still call it correctly. It is dense and uses shouty INSTEAD/IMPORTANT/NOTE markers, but every sentence carries actionable information rather than filler.

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?

Despite having no output schema, the description specifies the exact returned fields and the semantic gotchas (currency-wide delta aggregation, missing bid/ask, theta scaling), which is what an agent needs to interpret results. For a zero-dependency read tool this is complete.

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?

The single parameter subaccount_id has full schema description coverage, so the schema already explains it defaults to the configured subaccount. The description adds nothing about how the overview is scoped per subaccount, which is a missed opportunity but consistent with the baseline when schema coverage is high.

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?

States a specific verb and resource plus exact contents: USDC balance, all positions with greeks, and aggregate totals. It explicitly differentiates itself from the sibling pair get_collaterals and get_positions rather than leaving the agent to infer overlap.

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?

Gives an explicit routing rule (use this INSTEAD of get_collaterals + get_positions), a conditional caveat for per-currency hedging with the filtering idiom, and a redirect to get_tickers(expiry) when closing options. It covers when to use it, when its aggregate is wrong for the task, and which sibling to use instead.

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