Skip to main content
Glama
iaptic

Iaptic MCP Server

Official
by iaptic

event_list

Retrieve a paginated list of recent system events from your Iaptic account, including receipt validations, platform notifications, webhook deliveries, purchase status changes, and subscription renewals. Filter by date range.

Instructions

List recent events from your Iaptic account.

  • Returns a paginated list of system events

  • Events include:

    • Receipt validations

    • Platform notifications (Apple/Google/etc)

    • Webhook deliveries

    • Purchase status changes

    • Subscription renewals

  • Use limit and offset for pagination

  • Results ordered by date (newest first)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of events to return (default: 100)
offsetNoNumber of events to skip for pagination
startdateNoFilter events after this date (ISO format, e.g. 2024-01-01)
enddateNoFilter events before this date (ISO format, e.g. 2024-12-31)
rawNoReturn raw JSON instead of formatted output (default: false)

Implementation Reference

  • The _handleTool private method routes 'event_list' to call this.api.getEvents(args) and returns formatted or raw event data. This is the core handler logic for the event_list tool.
    private async _handleTool(name: string, args: any) {
      switch (name) {
        case 'event_list':
          console.error(`Fetching events with params:`, args);
          const events = await this.api.getEvents(args);
          console.error(`Retrieved ${events.rows?.length || 0} events`);
          if (args.raw) {
            return {
              content: [{
                type: "text",
                text: JSON.stringify(events.rows.slice(0, 20), null, 2)
              }]
            };
          }
          const formattedEvents = events.rows.slice(0,20).map(formatEvent).join('\n');
          console.error(formattedEvents);
          return {
            content: [{
              type: "text",
              text: formattedEvents
            }]
          };
  • The inputSchema for event_list defines parameters: limit, offset, startdate, enddate, raw, and optionally appName when using master key.
    inputSchema: {
      type: "object",
      properties: {
        limit: { 
          type: "number", 
          description: "Maximum number of events to return (default: 100)" 
        },
        offset: { 
          type: "number", 
          description: "Number of events to skip for pagination" 
        },
        startdate: {
          type: "string",
          description: "Filter events after this date (ISO format, e.g. 2024-01-01)"
        },
        enddate: {
          type: "string",
          description: "Filter events before this date (ISO format, e.g. 2024-12-31)"
        },
        raw: {
          type: "boolean",
          description: "Return raw JSON instead of formatted output (default: false)"
        },
        ...(appNameRequired ? {
          appName: {
            type: "string",
            description: "Name of the app to fetch data from. Required when using master key."
          }
        } : {})
      },
      required: appNameRequired ? ["appName"] : undefined
    }
  • The tool is registered with name 'event_list' in the getTools() method of the EventTools class, which returns tool definitions for MCP.
          {
            name: "event_list",
            description: `List recent events from your Iaptic account.
    - Returns a paginated list of system events
    - Events include:
      - Receipt validations
      - Platform notifications (Apple/Google/etc)
      - Webhook deliveries
      - Purchase status changes
      - Subscription renewals
    - Use limit and offset for pagination
    - Results ordered by date (newest first)${appNameRequired ? '\n- Requires appName parameter when using master key' : ''}`,
            inputSchema: {
              type: "object",
              properties: {
                limit: { 
                  type: "number", 
                  description: "Maximum number of events to return (default: 100)" 
                },
                offset: { 
                  type: "number", 
                  description: "Number of events to skip for pagination" 
                },
                startdate: {
                  type: "string",
                  description: "Filter events after this date (ISO format, e.g. 2024-01-01)"
                },
                enddate: {
                  type: "string",
                  description: "Filter events before this date (ISO format, e.g. 2024-12-31)"
                },
                raw: {
                  type: "boolean",
                  description: "Return raw JSON instead of formatted output (default: false)"
                },
                ...(appNameRequired ? {
                  appName: {
                    type: "string",
                    description: "Name of the app to fetch data from. Required when using master key."
                  }
                } : {})
              },
              required: appNameRequired ? ["appName"] : undefined
            }
          },
  • src/server.ts:68-81 (registration)
    The ListToolsRequestSchema handler collects all tools via getTools() and the CallToolRequestSchema handler routes 'event_' prefixed names to events.handleTool(). This is how the tool is wired into the MCP server.
    private setupHandlers() {
      // List available tools
      this.server.setRequestHandler(ListToolsRequestSchema, async () => {
        return {
          tools: [
            ...this.tools.customers.getTools(),
            ...this.tools.purchases.getTools(),
            ...this.tools.transactions.getTools(),
            ...this.tools.statistics.getTools(),
            ...this.tools.stripe.getTools(),
            ...this.tools.events.getTools(),
            ...this.tools.app.getTools()
          ]
        };
  • The formatEvent helper function formats a single IapticEvent into a human-readable string, used in the non-raw path of event_list.
    function formatEvent(event: IapticEvent): string {
      const { context, content } = event;
      const { transactions, products, refreshFailures } = content;
    
      // Start with basic event info
      let output = `### ${new Date(context.eventDate).toLocaleString()}: ${context.eventType} by ${context.applicationUsername || 'system'}`;
      output += `\n  eventId: ${event.eventId}`;
    
      // Flag errors from tags (dashboard equivalent: content.tags.error === "_X")
      if (content.tags?.error) {
        output += `\n  [ERROR] Use event_details for error info`;
      }
    
      // Add refresh failures if present
      if (refreshFailures?.length > 0) {
        output += '\nRefresh Failures:';
        output += refreshFailures.map(f => `\n  ${f.platform}: ${f.reason}`).join('');
      }
    
      // Format transaction info with more details
      if (transactions?.length > 0) {
        output += '\nTransactions:';
        output += transactions.map(t =>
          `\n  ${t.transactionId}: ${t.productId}${t.amountMicros ? ` (${(t.amountMicros/1000000).toFixed(2)} ${t.currency})` : ''}`
          + `${t.sandbox ? ' [SANDBOX]' : ''}`
          + `${t.isConsumed ? ' [CONSUMED]' : ''}`
          + `${t.isAcknowledged ? ' [ACKNOWLEDGED]' : ''}`
        ).join('');
      }
    
      // Add product info if present
      if (products?.length > 0) {
        output += '\nProducts:';
        output += products.map(p =>
          `\n  ${p.id} (${p.type})${p.offers?.[0]?.pricingPhases?.[0]?.priceMicros ?
            ` - ${(p.offers[0].pricingPhases[0].priceMicros/1000000).toFixed(2)} ${p.currency}` : ''}`
        ).join('');
      }
    
      return output;
    }
Behavior3/5

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

With no annotations, the description provides some behavioral info (pagination, ordering, event types) but does not disclose authentication needs, rate limits, or side effects. It sufficiently implies a read-only operation.

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

Conciseness5/5

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

The description is concise, uses bullet points for readability, and front-loads the main purpose. Every sentence adds useful information without redundancy.

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

Completeness4/5

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

For a list tool with 5 parameters and no output schema, the description covers event types, pagination, and ordering. It lacks details on error handling or return format but is largely complete.

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

Parameters4/5

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

Schema coverage is 100%, so baseline is 3. The description adds value by clarifying pagination and ordering behavior not in the schema, though it omits the 'raw' parameter.

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

Purpose5/5

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

The description clearly states the tool lists events from an Iaptic account, enumerates specific event types, and distinguishes from siblings like 'event_details' by implying a list vs. single event.

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

Usage Guidelines4/5

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

The description explains pagination with limit/offset and ordering by date, but does not explicitly compare to related tools like 'event_details' or state when not to use this tool.

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/iaptic/mcp-server-iaptic'

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