get_sui_coins
Retrieve Sui blockchain coin holdings for any address, with options to filter by coin type, paginate results, and select network.
Instructions
Get coins owned by an address
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| address | Yes | Sui address | |
| coinType | No | Optional: Coin type to filter (e.g., "0x2::sui::SUI") | |
| cursor | No | Optional: Pagination cursor | |
| limit | No | Optional: Number of results to return | |
| network | No | Network type (defaults to mainnet) |
Implementation Reference
- src/handlers/sui-handlers.ts:53-83 (schema)Input schema and metadata definition for the get_sui_coins tool{ name: 'get_sui_coins', description: 'Get coins owned by an address', inputSchema: { type: 'object', properties: { address: { type: 'string', description: 'Sui address', }, coinType: { type: 'string', description: 'Optional: Coin type to filter (e.g., "0x2::sui::SUI")', }, cursor: { type: 'string', description: 'Optional: Pagination cursor', }, limit: { type: 'number', description: 'Optional: Number of results to return', }, network: { type: 'string', enum: ['mainnet', 'testnet'], description: 'Network type (defaults to mainnet)', }, }, required: ['address'], }, },
- src/handlers/sui-handlers.ts:337-355 (handler)Handler case in handleSuiTool that extracts arguments and delegates to SuiService.getCoinscase 'get_sui_coins': { const address = args?.address as string; const coinType = args?.coinType as string | undefined; const cursor = args?.cursor as string | undefined; const limit = args?.limit as number | undefined; const network = (args?.network as 'mainnet' | 'testnet') || 'mainnet'; const result = await suiService.getCoins(address, coinType, cursor, limit, network); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], isError: !result.success, }; }
- src/services/sui-service.ts:82-104 (handler)Core implementation of get_sui_coins: constructs RPC parameters and calls suix_getCoins RPC methodasync getCoins( address: string, coinType?: string, cursor?: string, limit?: number, network: 'mainnet' | 'testnet' = 'mainnet' ): Promise<EndpointResponse> { const service = this.blockchainService.getServiceByBlockchain('sui', network); if (!service) { return { success: false, error: `Sui service not found for ${network}`, }; } const params: any[] = [address]; if (coinType) params.push(coinType); if (cursor) params.push(cursor); if (limit) params.push(limit); return this.blockchainService.callRPCMethod(service.id, 'suix_getCoins', params); }
- src/index.ts:98-101 (registration)Registers all Sui tools (including get_sui_coins schema) by calling registerSuiHandlers...registerCosmosHandlers(server, cosmosService), ...registerSuiHandlers(server, suiService), ...registerDocsHandlers(server, docsManager), ];
- src/index.ts:123-126 (handler)Top-level tool dispatch that routes get_sui_coins to handleSuiTool(await handleSolanaTool(name, args, solanaService)) || (await handleCosmosTool(name, args, cosmosService)) || (await handleSuiTool(name, args, suiService)) || (await handleDocsTool(name, args, docsManager));