Skip to main content
Glama
buildwithgrove

Grove's MCP Server for Pocket Network

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
NameRequiredDescriptionDefault
addressYesSui address
coinTypeNoOptional: Coin type to filter (e.g., "0x2::sui::SUI")
cursorNoOptional: Pagination cursor
limitNoOptional: Number of results to return
networkNoNetwork type (defaults to mainnet)

Implementation Reference

  • 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'], }, },
  • Handler case in handleSuiTool that extracts arguments and delegates to SuiService.getCoins
    case '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, }; }
  • Core implementation of get_sui_coins: constructs RPC parameters and calls suix_getCoins RPC method
    async 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), ];
  • 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));

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/buildwithgrove/mcp-pocket'

If you have feedback or need assistance with the MCP directory API, please join our Discord server