get_sui_object
Retrieve detailed information about Sui blockchain objects using their unique ID, including type, ownership, content, and transaction history.
Instructions
Get object details by ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| network | No | Network type (defaults to mainnet) | |
| objectId | Yes | Sui object ID | |
| options | No | Optional: Display options |
Implementation Reference
- src/handlers/sui-handlers.ts:357-373 (handler)MCP tool handler implementation for 'get_sui_object'. Extracts parameters and calls SuiService.getObject, formats response.case 'get_sui_object': { const objectId = args?.objectId as string; const options = args?.options as any; const network = (args?.network as 'mainnet' | 'testnet') || 'mainnet'; const result = await suiService.getObject(objectId, options, network); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], isError: !result.success, }; }
- src/handlers/sui-handlers.ts:84-115 (registration)Tool registration including name, description, and input schema for 'get_sui_object'. Returned by registerSuiHandlers.{ name: 'get_sui_object', description: 'Get object details by ID', inputSchema: { type: 'object', properties: { objectId: { type: 'string', description: 'Sui object ID', }, options: { type: 'object', description: 'Optional: Display options', properties: { showType: { type: 'boolean' }, showOwner: { type: 'boolean' }, showPreviousTransaction: { type: 'boolean' }, showDisplay: { type: 'boolean' }, showContent: { type: 'boolean' }, showBcs: { type: 'boolean' }, showStorageRebate: { type: 'boolean' }, }, }, network: { type: 'string', enum: ['mainnet', 'testnet'], description: 'Network type (defaults to mainnet)', }, }, required: ['objectId'], }, },
- src/services/sui-service.ts:109-145 (helper)Core implementation of getObject in SuiService, which constructs RPC parameters and calls blockchainService.callRPCMethod('sui_getObject').async getObject( objectId: string, options?: { showType?: boolean; showOwner?: boolean; showPreviousTransaction?: boolean; showDisplay?: boolean; showContent?: boolean; showBcs?: boolean; showStorageRebate?: boolean; }, 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[] = [objectId]; if (options) { params.push({ showType: options.showType, showOwner: options.showOwner, showPreviousTransaction: options.showPreviousTransaction, showDisplay: options.showDisplay, showContent: options.showContent, showBcs: options.showBcs, showStorageRebate: options.showStorageRebate, }); } return this.blockchainService.callRPCMethod(service.id, 'sui_getObject', params); }