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

NameRequiredDescriptionDefault
requestYesComplete request for wallet PnL for token (flattened).

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changed
    • addedInput schema / properties / request / additionalProperties
      Added value: +false
    • removedInput schema / properties / request / anyOf
      Removed 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 token or date (YYYY-MM-DD or ___-MM-DD). Durations use exact rolling UTC timestamps; dates and calendar tokens start at midnight.",
      -            "type": "string"
      -          },
      -          "to": {
      -            "description": "End token or date (YYYY-MM-DD or ___-MM-DD). Durations use exact rolling UTC timestamps without an extra day. Dates and calendar tokens include the final date; TODAY_START stays at midnight.",
      -            "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"
      -  }
      -]
    • addedInput schema / properties / request / description
      Added value: +"Complete request for wallet PnL for token (flattened)."
    • addedInput schema / properties / request / properties
      Added value: +{
      +  "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": {
      +    "additionalProperties": false,
      +    "description": "Date range for PnL analysis",
      +    "properties": {
      +      "from": {
      +        "description": "Start token or date (YYYY-MM-DD or ___-MM-DD). Durations use exact rolling UTC timestamps; dates and calendar tokens start at midnight.",
      +        "type": "string"
      +      },
      +      "to": {
      +        "description": "End token or date (YYYY-MM-DD or ___-MM-DD). Durations use exact rolling UTC timestamps without an extra day. Dates and calendar tokens include the final date; TODAY_START stays at midnight.",
      +        "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"
      +  }
      +}
    • addedInput schema / properties / request / required
      Added value: +[
      +  "walletAddress",
      +  "tokenAddress",
      +  "dateRange",
      +  "showRealized"
      +]
    • addedInput schema / properties / request / type
      Added value: +"object"
  2. 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",
      -        "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"
      -  }
      -]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 token or date (YYYY-MM-DD or ___-MM-DD). Durations use exact rolling UTC timestamps; dates and calendar tokens start at midnight.",
      +            "type": "string"
      +          },
      +          "to": {
      +            "description": "End token or date (YYYY-MM-DD or ___-MM-DD). Durations use exact rolling UTC timestamps without an extra day. Dates and calendar tokens include the final date; TODAY_START stays at midnight.",
      +            "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"
      +  }
      +]
  3. 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"
      +  }
      +]
  4. 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"
      +  }
      +]
  5. First observed

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already cover read-only, non-destructive, open-world safety, so the description's added value is the chain semantics: on 'hyperliquid' the tokenAddress is a perp symbol, not a contract address, with concrete examples. That is a real behavioral constraint an agent would otherwise get wrong, though it largely restates the schema's chain field.

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 purpose in sentence one, usage in sentence two, then the non-obvious chain caveat set off as its own block. Every sentence earns its place; the only redundancy is repeating the schema's chain wording.

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?

An output schema exists, so return values need not be explained. Combined with a fully described nested request object, the description supplies the one thing the schema can't convey contextually — that perp lookups take a symbol. Minor gap: no statement of error behavior for unsupported chains or non-EVM wallets.

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?

Schema description coverage is 100%, so the schema already documents walletAddress, tokenAddress, dateRange tokens and the showRealized/hyperliquid interaction. The description's chain/tokenAddress note duplicates the schema's chain field verbatim and adds no formatting or edge-case detail beyond it, so baseline 3 applies.

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?

States a specific verb and resource ('Get PnL stats for a specific token traded by the input address') plus the scoping dimensions (token + date range). It differentiates implicitly from wallet_pnl_summary by emphasizing the single-token focus, but never names the sibling, so an agent must infer the boundary.

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?

The second sentence gives an implied use case ('analysing the performance of the wallet for the specific token over a time period'), but there is no explicit when-not guidance and no mention of wallet_pnl_summary or token_pnl_leaderboard as alternatives. Usage is inferable rather than directed.

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