delete-token
Removes a specified token to manage API access and security for Terminal.shop interactions. Use to invalidate unused or compromised tokens.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tokenId | Yes |
Implementation Reference
- server.js:1138-1161 (handler)The handler function for the "delete-token" tool. It takes a tokenId, calls the terminalApi to delete the token at `/token/${tokenId}`, and returns an MCP-formatted response with success or error message.async ({ tokenId }) => { try { await terminalApi.delete(`/token/${tokenId}`); return { content: [ { type: "text", text: `Token deleted successfully`, }, ], }; } catch (error) { console.error(`Error deleting token ${tokenId}:`, error); return { content: [ { type: "text", text: `Error deleting token: ${error.message}`, }, ], isError: true, }; } },
- server.js:1135-1137 (schema)Input schema for the "delete-token" tool, defining 'tokenId' as a required string using Zod validation.{ tokenId: z.string(), },
- server.js:1134-1162 (registration)Registration of the "delete-token" tool using server.tool(name, schema, handler), which registers it with the MCP server."delete-token", { tokenId: z.string(), }, async ({ tokenId }) => { try { await terminalApi.delete(`/token/${tokenId}`); return { content: [ { type: "text", text: `Token deleted successfully`, }, ], }; } catch (error) { console.error(`Error deleting token ${tokenId}:`, error); return { content: [ { type: "text", text: `Error deleting token: ${error.message}`, }, ], isError: true, }; } }, );