Skip to main content
Glama
AgentX-ai

Mailchimp MCP Server

by AgentX-ai

get_order

Retrieve specific order details from Mailchimp stores using store and order IDs to access comprehensive purchase information for email marketing analysis.

Instructions

Get details of a specific order

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
store_idYesThe store ID
order_idYesThe order ID

Implementation Reference

  • The handler logic for the 'get_order' tool within the handleToolCall switch statement. It invokes the Mailchimp service to fetch the order and returns it as a JSON-formatted text response.
    case "get_order":
      const order = await service.getOrder(args.store_id, args.order_id);
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(order, null, 2),
          },
        ],
      };
  • The input schema and metadata definition for the 'get_order' tool, specifying required store_id and order_id parameters.
    {
      name: "get_order",
      description: "Get details of a specific order",
      inputSchema: {
        type: "object",
        properties: {
          store_id: {
            type: "string",
            description: "The store ID",
          },
          order_id: {
            type: "string",
            description: "The order ID",
          },
        },
        required: ["store_id", "order_id"],
      },
    },
  • src/index.ts:42-46 (registration)
    MCP server registration for listing tools, which includes the 'get_order' tool via getToolDefinitions.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools: getToolDefinitions(mailchimpService),
      };
    });
  • src/index.ts:52-59 (registration)
    MCP server registration for handling tool calls, dispatching to handleToolCall which processes 'get_order'.
    server.setRequestHandler(CallToolRequestSchema, async (request) => {
      try {
        return await handleToolCall(
          mailchimpService,
          request.params.name,
          request.params.arguments
        );
      } catch (error: any) {
  • Helper method in MailchimpService that performs the API request to retrieve order details from Mailchimp's e-commerce endpoint.
    async getOrder(storeId: string, orderId: string): Promise<MailchimpOrder> {
      return await this.makeRequest(
        `/ecommerce/stores/${storeId}/orders/${orderId}`
      );
    }

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/AgentX-ai/mailchimp-mcp'

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