create-card
Generate a digital card for secure transactions by providing a valid token, enabling streamlined interaction with Terminal.shop’s API for shopping and subscription management.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| token | Yes |
Implementation Reference
- server.js:963-991 (handler)The handler function for the 'create-card' tool. It takes a Stripe token, posts it to the /card endpoint via terminalApi, extracts the card ID from the response, and returns a success message with the card ID or an error message.async ({ token }) => { try { const response = await terminalApi.post("/card", { token, }); const cardID = response.data.data; return { content: [ { type: "text", text: `Card created successfully! Card ID: ${cardID}`, }, ], }; } catch (error) { console.error("Error creating card:", error); return { content: [ { type: "text", text: `Error creating card: ${error.message}`, }, ], isError: true, }; } },
- server.js:960-962 (schema)Zod schema defining the input parameters for the 'create-card' tool: a required 'token' string (likely a Stripe token).{ token: z.string(), },
- server.js:958-992 (registration)Registration of the 'create-card' MCP tool using server.tool(), specifying the name, input schema, and handler function.server.tool( "create-card", { token: z.string(), }, async ({ token }) => { try { const response = await terminalApi.post("/card", { token, }); const cardID = response.data.data; return { content: [ { type: "text", text: `Card created successfully! Card ID: ${cardID}`, }, ], }; } catch (error) { console.error("Error creating card:", error); return { content: [ { type: "text", text: `Error creating card: ${error.message}`, }, ], isError: true, }; } }, );