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.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"token": "<token>"
},
"name": "create-card"
}
}Input 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, }; } }, );