get_token_metadata
Retrieve token contract metadata including name, symbol, and decimals using the contract address to identify and interact with blockchain tokens.
Instructions
Get metadata for a token contract
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": {
"contractAddress": "<contractAddress>"
},
"name": "get_token_metadata"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| contractAddress | Yes | The contract address of the token |
Implementation Reference
- index.ts:723-736 (registration)Registration of the 'get_token_metadata' tool in the ListTools response, defining its name, description, and input schema.
{ name: "get_token_metadata", description: "Get metadata for a token contract", inputSchema: { type: "object", properties: { contractAddress: { type: "string", description: "The contract address of the token", }, }, required: ["contractAddress"], }, }, - index.ts:80-80 (schema)TypeScript type definition for the input parameters of the get_token_metadata tool.
type GetTokenMetadataParams = { contractAddress: string }; - index.ts:260-268 (helper)Validation function to check if arguments match GetTokenMetadataParams type, used in handler.
const isValidGetTokenMetadataParams = ( args: any ): args is GetTokenMetadataParams => { return ( typeof args === "object" && args !== null && typeof args.contractAddress === "string" ); };