create-card
Generate a secure payment token for processing transactions through the Terminal.shop MCP Server. This tool creates payment cards to facilitate purchases, order placements, 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 Terminal API /card endpoint to create a new payment card, and returns the new 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:961-962 (schema)Input schema for the 'create-card' tool, requiring a string 'token' (Stripe token).token: z.string(), },
- server.js:958-992 (registration)Registration of the 'create-card' tool using server.tool(), including inline schema and handler.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, }; } }, );