get_sui_owned_objects
Retrieve objects owned by a specific Sui blockchain address, with options to filter results, paginate through data, and select network type.
Instructions
Get objects owned by an address
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| address | Yes | Sui address | |
| cursor | No | Optional: Pagination cursor | |
| limit | No | Optional: Number of results to return | |
| network | No | Network type (defaults to mainnet) | |
| query | No | Optional: Query filter and options |
Implementation Reference
- src/handlers/sui-handlers.ts:375-393 (handler)Handler logic in handleSuiTool switch case: extracts parameters from args, invokes SuiService.getOwnedObjects, formats result as MCP response.case 'get_sui_owned_objects': { const address = args?.address as string; const query = args?.query as any; 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.getOwnedObjects(address, query, cursor, limit, network); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], isError: !result.success, }; }
- src/handlers/sui-handlers.ts:116-146 (schema)Input schema, name, and description for the 'get_sui_owned_objects' tool defined in registerSuiHandlers.{ name: 'get_sui_owned_objects', description: 'Get objects owned by an address', inputSchema: { type: 'object', properties: { address: { type: 'string', description: 'Sui address', }, query: { type: 'object', description: 'Optional: Query filter and options', }, 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/services/sui-service.ts:150-175 (helper)Core implementation in SuiService.getOwnedObjects: retrieves Sui RPC service and calls 'suix_getOwnedObjects' RPC method with constructed parameters.async getOwnedObjects( address: string, query?: { filter?: any; options?: any; }, 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 (query) params.push(query); if (cursor) params.push(cursor); if (limit) params.push(limit); return this.blockchainService.callRPCMethod(service.id, 'suix_getOwnedObjects', params); }