Skip to main content
Glama
alamedaim-apps

Authorize.net MCP Server

get_batch_statistics

Retrieve aggregate statistics for a specific Authorize.net batch, including totals and payment method breakdowns.

Instructions

Get aggregate statistics for a specific batch (totals, counts by card type, etc.).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
batchIdYesThe batch ID to retrieve statistics for.

Implementation Reference

  • The core handler function that constructs the Authorize.Net GetBatchStatisticsRequest, authenticates, executes the API controller, processes the response, handles errors, and returns the batch statistics.
    async function getBatchStatistics(batchId: string) {
      const request = new ApiContracts.GetBatchStatisticsRequest();
      request.setMerchantAuthentication(getMerchantAuth());
      request.setBatchId(batchId);
    
      const ctrl = new ApiControllers.GetBatchStatisticsController(request.getJSON());
      const response = await executeController(ctrl);
    
      const apiResponse = new ApiContracts.GetBatchStatisticsResponse(response);
      if (apiResponse.getMessages().getResultCode() !== ApiContracts.MessageTypeEnum.OK) {
        const errors = apiResponse.getMessages().getMessage();
        throw new Error(`API Error: ${errors[0].getCode()} - ${errors[0].getText()}`);
      }
    
      return apiResponse.getBatch();
    }
  • The input schema definition for the get_batch_statistics tool, specifying the required batchId parameter.
      inputSchema: {
        type: "object",
        properties: {
          batchId: {
            type: "string",
            description: "The batch ID to retrieve statistics for.",
          },
        },
        required: ["batchId"],
      },
    },
  • src/index.ts:267-281 (registration)
    Tool registration in the ListTools response, including name, description, and schema.
    {
      name: "get_batch_statistics",
      description: "Get aggregate statistics for a specific batch (totals, counts by card type, etc.).",
      inputSchema: {
        type: "object",
        properties: {
          batchId: {
            type: "string",
            description: "The batch ID to retrieve statistics for.",
          },
        },
        required: ["batchId"],
      },
    },
    {
  • src/index.ts:324-326 (registration)
    Registration in the CallToolRequest switch statement that dispatches to the handler.
    case "get_batch_statistics":
      result = await getBatchStatistics(args?.batchId as string);
      break;
  • Helper function used by all tools, including getBatchStatistics, to execute Authorize.Net API controllers with Promise wrapping and environment handling.
    function executeController(ctrl: any): Promise<any> {
      return new Promise((resolve, reject) => {
        if (ENVIRONMENT === "production") {
          ctrl.setEnvironment(SDKConstants.endpoint.production);
        }
        ctrl.execute(() => {
          const response = ctrl.getResponse();
          if (response === null) {
            reject(new Error(ctrl.getErrorResponse() || "No response from API"));
          } else {
            resolve(response);
          }
        });
      });
    }
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. It states this is a read operation ('Get'), but doesn't describe response format, error conditions, performance characteristics, or whether it requires specific permissions. For a tool with no annotation coverage, this leaves significant gaps in understanding how it behaves.

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

Conciseness4/5

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

The description is a single, efficient sentence that front-loads the core purpose. Every element ('Get aggregate statistics', 'for a specific batch', examples) earns its place. It could be slightly more structured with separate usage guidance, but it avoids redundancy and waste.

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 no annotations, no output schema, and a single parameter with good schema coverage, the description is incomplete. It doesn't explain what the statistics look like (format, units), whether they're real-time or historical, or error handling. For a statistics tool with no structured output documentation, more context is needed to be fully helpful.

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%, with the single parameter 'batchId' fully documented in the schema. The description doesn't add any parameter-specific information beyond what the schema provides (e.g., format examples, valid ranges, or relationship to statistics). The baseline score of 3 is appropriate when the schema does the heavy lifting.

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

Purpose4/5

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

The description clearly states the verb ('Get') and resource ('aggregate statistics for a specific batch'), with specific examples of what statistics are included ('totals, counts by card type, etc.'). It distinguishes this from siblings that focus on transactions, customers, merchants, or batch lists rather than batch statistics. However, it doesn't explicitly differentiate from hypothetical similar tools like 'get_batch_details' or 'get_batch_summary'.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing a valid batch ID), exclusions (e.g., not for real-time data), or comparisons to sibling tools (e.g., use get_settled_batch_list to find batch IDs first). The context is implied but not stated.

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/alamedaim-apps/authnet-mcp'

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