Skip to main content
Glama
buildwithgrove

Grove's MCP Server for Pocket Network

get_sui_owned_objects

Retrieve objects owned by a Sui address to inspect assets and manage blockchain data across networks using Grove's MCP Server.

Instructions

Get objects owned by an address

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressYesSui address
queryNoOptional: Query filter and options
cursorNoOptional: Pagination cursor
limitNoOptional: Number of results to return
networkNoNetwork type (defaults to mainnet)

Implementation Reference

  • Handler execution logic for the 'get_sui_owned_objects' tool. Extracts arguments and delegates to SuiService.getOwnedObjects, then formats and returns the result.
    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,
      };
    }
  • Tool registration including name, description, and input schema definition in the registerSuiHandlers function.
    {
      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'],
      },
    },
  • Helper method in SuiService that constructs RPC parameters and calls the underlying 'suix_getOwnedObjects' RPC method via blockchainService.
    /**
     * Get objects owned by an address
     */
    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);
    }

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