Skip to main content
Glama
iaptic

Iaptic MCP Server

Official
by iaptic

purchase_get

Retrieve detailed information about a specific purchase, including product details, status, transactions, customer data, and subscription information by providing the purchase ID.

Instructions

Get detailed information about a specific purchase.

  • Returns complete purchase details including:

    • Product information

    • Purchase status

    • Associated transactions

    • Customer information

    • Subscription details (if applicable)

  • Required: purchaseId parameter

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
purchaseIdYesUnique identifier of the purchase

Implementation Reference

  • Handler for 'purchase_get' tool: calls this.api.getPurchase(args.purchaseId) and returns the purchase details as JSON text content.
    case 'purchase_get':
      const purchase = await this.api.getPurchase(args.purchaseId, { appName: args.appName });
      return {
        content: [{
          type: "text",
          text: JSON.stringify(purchase, null, 2)
        }]
      };
  • Schema definition for 'purchase_get' tool: defines name, description, and inputSchema with required purchaseId (string) and optional appName for master key users.
          {
            name: "purchase_get",
            description: `Get detailed information about a specific purchase.
    - Returns complete purchase details including:
      - Product information
      - Purchase status
      - Associated transactions
      - Customer information
      - Subscription details (if applicable)
    - Required: purchaseId parameter${appNameRequired ? '\n- Requires appName parameter when using master key' : ''}`,
            inputSchema: {
              type: "object",
              properties: {
                purchaseId: { 
                  type: "string", 
                  description: "Unique identifier of the purchase" 
                },
                ...(appNameRequired ? {
                  appName: {
                    type: "string",
                    description: "Name of the app to fetch data from. Required when using master key."
                  }
                } : {})
              },
              required: appNameRequired ? ["purchaseId", "appName"] : ["purchaseId"]
            }
          }
  • Low-level API method getPurchase(): makes a GET request to /purchases/{purchaseId} and returns the response data.
    async getPurchase(purchaseId: string, params?: { appName?: string }) {
      const response = await this.client.get(`/purchases/${purchaseId}`, { params });
      return response.data;
    }
  • src/server.ts:84-125 (registration)
    Registration: server.ts routes tool calls with name prefix 'purchase_' to PurchaseTools.handleTool(), which dispatches to the 'purchase_get' case.
    // Handle tool calls
    this.server.setRequestHandler(CallToolRequestSchema, async (request) => {
      const { name, arguments: args } = request.params;
      
      try {
        // Route tool calls to appropriate handler
        if (name.startsWith('customer_')) {
          return await this.tools.customers.handleTool(name, args);
        }
        if (name.startsWith('purchase_')) {
          return await this.tools.purchases.handleTool(name, args);
        }
        if (name.startsWith('transaction_')) {
          return await this.tools.transactions.handleTool(name, args);
        }
        if (name.startsWith('stats_')) {
          return await this.tools.statistics.handleTool(name, args);
        }
        if (name.startsWith('stripe_')) {
          return await this.tools.stripe.handleTool(name, args);
        }
        if (name.startsWith('event_')) {
          return await this.tools.events.handleTool(name, args);
        }
        if (name.startsWith('iaptic_')) {
          return await this.tools.app.handleTool(name, args);
        }
    
        throw new Error(`Unknown tool: ${name}`);
      } catch (error: unknown) {
        const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
        console.error(`Error handling tool ${name}:`, errorMessage);
        if (error instanceof Error && error.stack) {
          console.error(error.stack);
        }
    
        return {
          isError: true,
          content: [{ type: "text", text: `Error: ${errorMessage}` }]
        };
      }
    });
Behavior4/5

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

Despite no annotations, the description lists what information is returned (product, status, transactions, customer, subscription), which gives good transparency for a read-only tool. No side effects are mentioned, but the read nature is clear.

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 very concise, using one sentence and a bullet list to organize information efficiently. No wasted words.

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 simple tool with one required parameter and no output schema, the description provides a good overview of what is returned, which is sufficient for the agent to understand the tool's purpose.

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 coverage is 100% with the parameter 'purchaseId' described as 'Unique identifier of the purchase'. The description adds no extra semantics beyond requiring it, so a baseline of 3 is appropriate.

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 'Get detailed information about a specific purchase' with a specific verb and resource, and distinguishes from sibling like 'purchase_list' by focusing on a single purchase.

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

Usage Guidelines3/5

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

While the description implies when to use (when you need detailed info on one purchase), it does not explicitly state when not to use or contrast with alternatives like 'purchase_list'.

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