Skip to main content
Glama
pashaydev

Terminal.shop MCP Server

by pashaydev

set-cart-address

Assign a specific address to the shopping cart in Terminal.shop by providing the addressID, enabling accurate order delivery and checkout processes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressIDYes

Implementation Reference

  • The handler function for the 'set-cart-address' tool. It makes a PUT request to '/cart/address' with the provided addressID using terminalApi, and returns a success message or an error message with isError flag.
    async ({ addressID }) => { try { const response = await terminalApi.put("/cart/address", { addressID, }); return { content: [ { type: "text", text: "Successfully set shipping address for your cart.", }, ], }; } catch (error) { console.error("Error setting cart address:", error); return { content: [ { type: "text", text: `Error setting cart address: ${error.message}`, }, ], isError: true, }; } },
  • The input schema for the 'set-cart-address' tool, defining addressID as a required string using Zod.
    { addressID: z.string(), },
  • server.js:619-651 (registration)
    The registration of the 'set-cart-address' tool using server.tool(), including schema and handler function.
    server.tool( "set-cart-address", { addressID: z.string(), }, async ({ addressID }) => { try { const response = await terminalApi.put("/cart/address", { addressID, }); return { content: [ { type: "text", text: "Successfully set shipping address for your cart.", }, ], }; } catch (error) { console.error("Error setting cart address:", error); return { content: [ { type: "text", text: `Error setting cart address: ${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