Skip to main content
Glama
buildwithgrove

Grove's MCP Server for Pocket Network

query_sui_events

Query and filter blockchain events on the Sui network to monitor smart contract activity, track transactions, and analyze on-chain data.

Instructions

Query Sui events

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesEvent query filter
cursorNoOptional: Pagination cursor
limitNoOptional: Number of results to return
descendingOrderNoOptional: Sort order (default: false)
networkNoNetwork type (defaults to mainnet)

Implementation Reference

  • Handler logic for the 'query_sui_events' tool. Extracts parameters from args and calls SuiService.queryEvents, then formats the response.
    case 'query_sui_events': {
      const query = args?.query as any;
      const cursor = args?.cursor as string | undefined;
      const limit = args?.limit as number | undefined;
      const descendingOrder = args?.descendingOrder as boolean | undefined;
      const network = (args?.network as 'mainnet' | 'testnet') || 'mainnet';
    
      const result = await suiService.queryEvents(query, cursor, limit, descendingOrder, network);
    
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result, null, 2),
          },
        ],
        isError: !result.success,
      };
    }
  • Tool definition including name, description, and input schema for 'query_sui_events'.
    {
      name: 'query_sui_events',
      description: 'Query Sui events',
      inputSchema: {
        type: 'object',
        properties: {
          query: {
            type: 'object',
            description: 'Event query filter',
          },
          cursor: {
            type: 'string',
            description: 'Optional: Pagination cursor',
          },
          limit: {
            type: 'number',
            description: 'Optional: Number of results to return',
          },
          descendingOrder: {
            type: 'boolean',
            description: 'Optional: Sort order (default: false)',
          },
          network: {
            type: 'string',
            enum: ['mainnet', 'testnet'],
            description: 'Network type (defaults to mainnet)',
          },
        },
        required: ['query'],
      },
    },
  • Core implementation of event querying via RPC call to 'suix_queryEvents' on the Sui blockchain service.
    async queryEvents(
      query: any,
      cursor?: string,
      limit?: number,
      descendingOrder?: 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[] = [query];
      if (cursor !== undefined) params.push(cursor);
      if (limit !== undefined) params.push(limit);
      if (descendingOrder !== undefined) params.push(descendingOrder);
    
      return this.blockchainService.callRPCMethod(service.id, 'suix_queryEvents', params);
    }
  • src/index.ts:87-101 (registration)
    Registration of all tools, including Sui handlers which define 'query_sui_events', into the server's tool list.
    // Register all tools from handlers
    const tools: Tool[] = [
      ...registerBlockchainHandlers(server, blockchainService),
      ...registerDomainHandlers(server, domainResolver),
      ...registerTransactionHandlers(server, advancedBlockchain),
      ...registerTokenHandlers(server, advancedBlockchain),
      ...registerMultichainHandlers(server, advancedBlockchain),
      ...registerContractHandlers(server, advancedBlockchain),
      ...registerUtilityHandlers(server, advancedBlockchain),
      ...registerEndpointHandlers(server, endpointManager),
      ...registerSolanaHandlers(server, solanaService),
      ...registerCosmosHandlers(server, cosmosService),
      ...registerSuiHandlers(server, suiService),
      ...registerDocsHandlers(server, docsManager),
    ];
  • src/index.ts:114-126 (registration)
    Dispatch chain in tool execution handler that routes 'query_sui_events' to handleSuiTool.
    let result =
      (await handleBlockchainTool(name, args, blockchainService)) ||
      (await handleDomainTool(name, args, domainResolver)) ||
      (await handleTransactionTool(name, args, advancedBlockchain)) ||
      (await handleTokenTool(name, args, advancedBlockchain)) ||
      (await handleMultichainTool(name, args, advancedBlockchain)) ||
      (await handleContractTool(name, args, advancedBlockchain)) ||
      (await handleUtilityTool(name, args, advancedBlockchain)) ||
      (await handleEndpointTool(name, args, endpointManager)) ||
      (await handleSolanaTool(name, args, solanaService)) ||
      (await handleCosmosTool(name, args, cosmosService)) ||
      (await handleSuiTool(name, args, suiService)) ||
      (await handleDocsTool(name, args, docsManager));
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. 'Query Sui events' suggests a read-only operation, but it doesn't clarify whether this requires authentication, what rate limits might apply, what format the results come in, whether pagination is handled automatically, or what happens with invalid queries. For a tool with 5 parameters and no annotations, this is a significant gap in behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

While technically concise with only three words, this is a case of under-specification rather than effective brevity. The description fails to provide any meaningful information that would help an AI agent understand when and how to use this tool. Every word should earn its place, but here the words don't provide sufficient value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (5 parameters including a nested query object), lack of annotations, and absence of an output schema, the description is woefully incomplete. It doesn't explain what the tool returns, how events are structured, what query capabilities exist, or any behavioral characteristics. For a query tool with significant parameter complexity, this description provides inadequate context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all 5 parameters with descriptions. The tool description adds no additional parameter information beyond what's in the schema - it doesn't explain what constitutes a valid 'Event query filter', how the cursor works, typical limit values, or network implications. With complete schema coverage, the baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose2/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Query Sui events' is a tautology that essentially restates the tool name. It specifies the resource ('Sui events') and a generic verb ('query'), but provides no information about what kind of events, what querying entails, or how this differs from sibling tools like 'query_sui_transactions' or 'search_logs'. The purpose is minimally stated but lacks any meaningful differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides absolutely no guidance on when to use this tool versus alternatives. With many sibling tools available (including 'query_sui_transactions', 'search_logs', and various other query/search tools), there is no indication of what makes this tool distinct or when it should be selected over similar options. The description offers zero usage context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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