Skip to main content
Glama
pashaydev

Terminal.shop MCP Server

by pashaydev

create-order

Process customer orders by specifying variants, address, and payment details directly within Terminal.shop MCP Server.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressIDYes
cardIDYes
variantsYes

Implementation Reference

  • The handler function for the 'create-order' tool. It sends a POST request to the Terminal.shop /order endpoint with the provided variants (product variant IDs mapped to quantities), addressID, and cardID. Returns success message with order ID or error.
    async ({ variants, addressID, cardID }) => { try { const response = await terminalApi.post("/order", { variants, addressID, cardID, }); const orderID = response.data.data; return { content: [ { type: "text", text: `Order created successfully! Order ID: ${orderID}`, }, ], }; } catch (error) { console.error("Error creating order:", error); return { content: [ { type: "text", text: `Error creating order: ${error.message}`, }, ], isError: true, }; } },
  • Input schema using Zod: variants as a record of variant ID strings to quantity numbers, addressID string, cardID string.
    { variants: z.record(z.string(), z.number()), addressID: z.string(), cardID: z.string(), },
  • server.js:776-814 (registration)
    Registration of the 'create-order' tool using server.tool(), including name, input schema, and inline handler function.
    server.tool( "create-order", { variants: z.record(z.string(), z.number()), addressID: z.string(), cardID: z.string(), }, async ({ variants, addressID, cardID }) => { try { const response = await terminalApi.post("/order", { variants, addressID, cardID, }); const orderID = response.data.data; return { content: [ { type: "text", text: `Order created successfully! Order ID: ${orderID}`, }, ], }; } catch (error) { console.error("Error creating order:", error); return { content: [ { type: "text", text: `Error creating order: ${error.message}`, }, ], isError: true, }; } }, );

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/pashaydev/terminal.shop.mcp'

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