get_asset_info
Retrieve detailed information about Algorand Standard Assets by providing the asset ID, enabling users to verify asset properties and metadata on the blockchain.
Instructions
Get information about an Algorand Standard Asset
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| assetId | Yes | Asset ID to query |
Implementation Reference
- src/index.ts:677-700 (handler)MCP tool handler for 'get_asset_info' that parses arguments, calls algorandService.getAssetInfo, and formats the response or error.case 'get_asset_info': { const parsed = GetAssetInfoArgsSchema.parse(args); try { const assetInfo = await algorandService.getAssetInfo(parsed.assetId); return { content: [ { type: 'text', text: `Asset Information:\n${JSON.stringify(assetInfo, null, 2)}`, }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error getting asset info: ${error}`, }, ], isError: true, }; } }
- src/index.ts:71-73 (schema)Zod schema for validating input arguments to the get_asset_info tool (assetId: number).const GetAssetInfoArgsSchema = z.object({ assetId: z.number(), });
- src/index.ts:295-308 (registration)Tool registration in the TOOLS array, defining name, description, and inputSchema for MCP server.{ name: 'get_asset_info', description: 'Get information about an Algorand Standard Asset', inputSchema: { type: 'object', properties: { assetId: { type: 'number', description: 'Asset ID to query', }, }, required: ['assetId'], }, },
- src/algorand.ts:315-325 (helper)Core implementation in AlgorandService class that queries the algod client for asset information by ID.async getAssetInfo(assetId: number) { try { const assetInfo = await this.algodClient.getAssetByID(assetId).do(); return { id: assetInfo.index, params: assetInfo.params, }; } catch (error) { throw new Error(`Failed to get asset info: ${error}`); } }