Skip to main content
Glama
pashaydev

Terminal.shop MCP Server

by pashaydev

set-cart-card

Assign a payment card to the shopping cart for checkout in Terminal.shop. Use this tool to link a card ID to your cart before completing purchases.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cardIDYes

Implementation Reference

  • Handler function for 'set-cart-card' tool that sets the payment card on the cart by calling terminalApi.put('/cart/card', {cardID}) and returns success or error message.
    async ({ cardID }) => { try { const response = await terminalApi.put("/cart/card", { cardID, }); return { content: [ { type: "text", text: "Successfully set payment method for your cart.", }, ], }; } catch (error) { console.error("Error setting cart payment method:", error); return { content: [ { type: "text", text: `Error setting cart payment method: ${error.message}`, }, ], isError: true, }; } },
  • Input schema for 'set-cart-card' tool defining cardID as a string using Zod.
    { cardID: z.string(), },
  • server.js:654-686 (registration)
    Registration of the 'set-cart-card' tool using server.tool() with name, schema, and inline handler.
    server.tool( "set-cart-card", { cardID: z.string(), }, async ({ cardID }) => { try { const response = await terminalApi.put("/cart/card", { cardID, }); return { content: [ { type: "text", text: "Successfully set payment method for your cart.", }, ], }; } catch (error) { console.error("Error setting cart payment method:", error); return { content: [ { type: "text", text: `Error setting cart payment method: ${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