Skip to main content
Glama

Calculating token performance

wallet_pnl_for_token
Read-only

Get PnL stats for a specific token traded by the input address during a specific date range. Use this tool for analysing the performance of the wallet for the specific token over a time period.

Chain: pass 'hyperliquid' for a perp coin — there tokenAddress is the perp SYMBOL (e.g. 'BTC', 'HYPE', 'xyz:CL'), not a contract address. Every other chain expects a token contract address.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
requestYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / request / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": true,
      -    "type": "object"
      -  },
      -  {
      -    "description": "Complete request for wallet PnL for token (flattened).",
      -    "properties": {
      -      "chain": {
      -        "default": "evm",
      -        "type": "string"
      -      },
      -      "dateRange": {
      -        "description": "Date range for PnL analysis",
      -        "properties": {
      -          "from": {
      -            "description": "Start value: token (see above) or date (YYYY-MM-DD or ___-MM-DD).",
      -            "type": "string"
      -          },
      -          "to": {
      -            "description": "End value: token (see above) or date (YYYY-MM-DD or ___-MM-DD).",
      -            "type": "string"
      -          }
      -        },
      -        "required": [
      -          "from",
      -          "to"
      -        ],
      -        "type": "object"
      -      },
      -      "showRealized": {
      -        "description": "Set to true for realized PnL (completed/closed trades), false for current position analysis (unrealized PnL + active holdings)",
      -        "type": "boolean"
      -      },
      -      "tokenAddress": {
      -        "description": "Token address to generate PnL stats for",
      -        "type": "string"
      -      },
      -      "walletAddress": {
      -        "description": "The wallet address to analyze",
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "walletAddress",
      -      "tokenAddress",
      -      "dateRange",
      -      "showRealized"
      -    ],
      -    "type": "object"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": true,
      +    "type": "object"
      +  },
      +  {
      +    "description": "Complete request for wallet PnL for token (flattened).",
      +    "properties": {
      +      "chain": {
      +        "default": "evm",
      +        "description": "Blockchain to query. Use 'hyperliquid' for a Hyperliquid perp coin — then tokenAddress is the perp SYMBOL (e.g. 'BTC', 'HYPE', 'xyz:CL'), not a contract address, and the wallet must be an EVM address. Every other chain expects a token contract address.",
      +        "type": "string"
      +      },
      +      "dateRange": {
      +        "description": "Date range for PnL analysis",
      +        "properties": {
      +          "from": {
      +            "description": "Start value: token (see above) or date (YYYY-MM-DD or ___-MM-DD).",
      +            "type": "string"
      +          },
      +          "to": {
      +            "description": "End value: token (see above) or date (YYYY-MM-DD or ___-MM-DD).",
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "from",
      +          "to"
      +        ],
      +        "type": "object"
      +      },
      +      "showRealized": {
      +        "description": "Set to true for realized PnL (completed/closed trades), false for current position analysis (unrealized PnL + active holdings). Ignored on chain='hyperliquid', which always reports both.",
      +        "type": "boolean"
      +      },
      +      "tokenAddress": {
      +        "description": "Token address to generate PnL stats for",
      +        "type": "string"
      +      },
      +      "walletAddress": {
      +        "description": "The wallet address to analyze",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "walletAddress",
      +      "tokenAddress",
      +      "dateRange",
      +      "showRealized"
      +    ],
      +    "type": "object"
      +  }
      +]
  2. Changed3 schema fields changed
    • removedInput schema / $defs
      Removed value: -{
      -  "DateRange": {
      -    "description": "Date range via tokens or dates.\nTokens: NOW, XMIN_AGO, XD_AGO, XH_AGO; THIS_YEAR_START, THIS_QUARTER_START, THIS_MONTH_START, THIS_WEEK_START, TODAY_START; LAST_WEEK_START/END, LAST_MONTH_START/END, LAST_QUARTER_START/END, LAST_YEAR_START/END.\nWeek starts Monday. Quarters are calendar. Dates: YYYY-MM-DD or ___-MM-DD (year omitted).\nPlease check detailed system instructions for more information.",
      -    "properties": {
      -      "from": {
      -        "description": "Start value: token (see above) or date (YYYY-MM-DD or ___-MM-DD).",
      -        "type": "string"
      -      },
      -      "to": {
      -        "description": "End value: token (see above) or date (YYYY-MM-DD or ___-MM-DD).",
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "from",
      -      "to"
      -    ],
      -    "type": "object"
      -  },
      -  "WalletPnlForTokenRequest": {
      -    "description": "Complete request for wallet PnL for token (flattened).",
      -    "properties": {
      -      "chain": {
      -        "default": "evm",
      -        "type": "string"
      -      },
      -      "dateRange": {
      -        "$ref": "#/$defs/DateRange",
      -        "description": "Date range for PnL analysis"
      -      },
      -      "showRealized": {
      -        "description": "Set to true for realized PnL (completed/closed trades), false for current position analysis (unrealized PnL + active holdings)",
      -        "type": "boolean"
      -      },
      -      "tokenAddress": {
      -        "description": "Token address to generate PnL stats for",
      -        "type": "string"
      -      },
      -      "walletAddress": {
      -        "description": "The wallet address to analyze",
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "walletAddress",
      -      "tokenAddress",
      -      "dateRange",
      -      "showRealized"
      -    ],
      -    "type": "object"
      -  }
      -}
    • addedInput schema / additionalProperties
      Added value: +false
    • changedInput schema / properties / request / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": true,
      -    "type": "object"
      -  },
      -  {
      -    "$ref": "#/$defs/WalletPnlForTokenRequest"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": true,
      +    "type": "object"
      +  },
      +  {
      +    "description": "Complete request for wallet PnL for token (flattened).",
      +    "properties": {
      +      "chain": {
      +        "default": "evm",
      +        "type": "string"
      +      },
      +      "dateRange": {
      +        "description": "Date range for PnL analysis",
      +        "properties": {
      +          "from": {
      +            "description": "Start value: token (see above) or date (YYYY-MM-DD or ___-MM-DD).",
      +            "type": "string"
      +          },
      +          "to": {
      +            "description": "End value: token (see above) or date (YYYY-MM-DD or ___-MM-DD).",
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "from",
      +          "to"
      +        ],
      +        "type": "object"
      +      },
      +      "showRealized": {
      +        "description": "Set to true for realized PnL (completed/closed trades), false for current position analysis (unrealized PnL + active holdings)",
      +        "type": "boolean"
      +      },
      +      "tokenAddress": {
      +        "description": "Token address to generate PnL stats for",
      +        "type": "string"
      +      },
      +      "walletAddress": {
      +        "description": "The wallet address to analyze",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "walletAddress",
      +      "tokenAddress",
      +      "dateRange",
      +      "showRealized"
      +    ],
      +    "type": "object"
      +  }
      +]
  3. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, so the safety profile is covered. The description adds meaningful behavior beyond that: on 'hyperliquid', tokenAddress must be a perp symbol, not a contract address, and every other chain expects a contract address. No contradiction with 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?

The description is compact and front-loaded: purpose appears in the first sentence, followed by a clear special-case rule for chain handling. Every sentence earns its place without unnecessary detail.

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?

Given the output schema exists and the input schema includes detailed nested descriptions, the description is nearly complete. It could be stronger about showRealized behavior and how dateRange can accept tokens or dates, but those are already covered in the schema, so no critical calling information is missing.

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?

Although the schema coverage signal is 0%, the nested input schema actually documents all fields, including chain, dateRange, showRealized, tokenAddress, and walletAddress. The description adds the most important ambiguity—perp symbol vs contract address—but largely repeats the schema's chain note rather than adding new parameter meaning.

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 states a specific verb and resource: 'Get PnL stats for a specific token traded by the input address during a specific date range.' It also emphasizes 'specific token', which distinguishes it from the sibling wallet_pnl_summary and other wallet-level tools.

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?

The description explicitly says to use it for analyzing wallet performance for a specific token over a time period. It does not name alternatives or exclusion cases, but the context is clear enough to select this tool over wallet_pnl_summary or token-level tools.

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