Skip to main content
Glama
pashaydev

Terminal.shop MCP Server

by pashaydev

create-token

Generate API tokens for interacting with Terminal.shop, enabling AI assistants to browse products, manage carts, place orders, and handle subscriptions programmatically.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • server.js:1105-1130 (registration)
    Registers the 'create-token' tool with an empty input schema and an inline async handler function. The handler makes a POST request to the Terminal.shop API endpoint '/token' to create a new personal access token and returns the token ID and value in the response.
    server.tool("create-token", {}, async () => { try { const response = await terminalApi.post("/token"); const data = response.data.data; return { content: [ { type: "text", text: `Token created successfully!\n\nToken ID: ${data.id}\nToken: ${data.token}\n\nIMPORTANT: Save this token securely. You won't be able to see the full token value again.`, }, ], }; } catch (error) { console.error("Error creating token:", error); return { content: [ { type: "text", text: `Error creating token: ${error.message}`, }, ], isError: true, }; } });
  • The handler function for the 'create-token' tool. It performs a POST request to '/token' using the pre-configured axios instance 'terminalApi', extracts the token data, and formats a success response with the token ID and token value. Includes error handling.
    server.tool("create-token", {}, async () => { try { const response = await terminalApi.post("/token"); const data = response.data.data; return { content: [ { type: "text", text: `Token created successfully!\n\nToken ID: ${data.id}\nToken: ${data.token}\n\nIMPORTANT: Save this token securely. You won't be able to see the full token value again.`, }, ], }; } catch (error) { console.error("Error creating token:", error); return { content: [ { type: "text", text: `Error creating token: ${error.message}`, }, ], isError: true, }; } });
  • Empty input schema object for the 'create-token' tool, indicating no parameters are required.
    server.tool("create-token", {}, async () => {

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