get_asset_info
Retrieve detailed information about an Algorand Standard Asset by providing its unique Asset ID. Use this tool within the Algorand MCP Server to access essential asset data for blockchain operations.
Instructions
Get information about an Algorand Standard Asset
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| assetId | Yes | Asset ID to query |
Input Schema (JSON Schema)
{
"properties": {
"assetId": {
"description": "Asset ID to query",
"type": "number"
}
},
"required": [
"assetId"
],
"type": "object"
}
Implementation Reference
- src/index.ts:677-700 (handler)Handler logic in the main tool router switch statement that parses input arguments using the schema, calls the AlgorandService.getAssetInfo method, and formats the response as MCP content.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 the input arguments of 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, including name, description, and JSON inputSchema matching the Zod schema.{ 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 Algorand node for asset information by ID and returns simplified asset data.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}`); } }