Skip to main content
Glama
iaptic

Iaptic MCP Server

Official
by iaptic

stats_get

Get aggregated transaction, revenue, and usage statistics from your Iaptic account, including active subscriptions, customer growth, and revenue by product type.

Instructions

Get general transactions, revenue and usage statistics from your Iaptic account.

  • Returns aggregated metrics including:

    • Total revenue

    • Number of active subscriptions

    • Customer growth metrics

    • Transaction success rates

    • Revenue by product type

  • Data is aggregated across all your applications

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The actual handler for the 'stats_get' tool. It calls this.api.getStats({ appName }) and returns the result as JSON text.
    case 'stats_get':
      const stats = await this.api.getStats({ appName: args.appName });
      return {
        content: [{
          type: "text",
          text: JSON.stringify(stats, null, 2)
        }]
      };
  • Schema definition and registration for the 'stats_get' tool. Defines name, description, and optional inputSchema with appName parameter when using master key.
          {
            name: "stats_get",
            description: `Get general transactions, revenue and usage statistics from your Iaptic account.
    - Returns aggregated metrics including:
      - Total revenue
      - Number of active subscriptions
      - Customer growth metrics
      - Transaction success rates
      - Revenue by product type
    - Data is aggregated across all your applications${appNameRequired ? '\n- Requires appName parameter when using master key' : ''}`,
            inputSchema: {
              type: "object",
              properties: {
                ...(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-82 (registration)
    Registration in the MCP server: tools are listed via ListToolsRequestSchema handler (line 76) and routed to StatisticsTools.handleTool when name starts with 'stats_' (line 99-100).
    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 API helper: IapticAPI.getStats() makes a GET request to '/stats' endpoint. This is what the handler calls to fetch statistics data.
    async getStats(params?: { appName?: string }) {
      const response = await this.client.get('/stats', { params });
      return response.data;
    }
Behavior4/5

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

No annotations exist, so the description fully covers behavior: it returns aggregated metrics with a clear list. It doesn't mention rate limits or caching, but for a read-only stats tool, the description is adequate and does not omit critical details.

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, using bullet points for clarity. Each sentence adds value: purpose, list of metrics, and scope. No redundant or unnecessary information.

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

Completeness5/5

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

Though there is no output schema, the description enumerates the types of metrics returned (revenue, subscriptions, customer growth, etc.), which sufficiently describes what the agent can expect. With no parameters and a clear scope, the description is 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?

There are zero parameters, so baseline score is 4. The description adds no parameter info because none are needed; it correctly focuses on the returned metrics.

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 gets general statistics and lists specific aggregated metrics like total revenue and active subscriptions. It distinguishes from sibling 'stats_app' by specifying 'across all your applications', indicating it provides account-wide data.

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 implicitly defines when to use: when overall account statistics are needed. It doesn't explicitly mention alternatives like 'stats_app' for per-app stats, but the context of aggregated data across all apps provides sufficient guidance.

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