delete_gateway
Delete a payment gateway for your company. Fails if the gateway is linked to any currencies or customers.
Instructions
Delete a company gateway. DELETE /gateways/{gatewayId}. Fails if gateway is linked to company currencies or customers.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| gatewayId | Yes | Gateway ID (required) |
Implementation Reference
- The handler function that executes the delete_gateway tool logic. Parses input using Zod schema, then calls gatewayService.deleteGateway(client, gatewayId).
async function handler(client: Client, args: Record<string, unknown> | undefined) { const parsed = schema.safeParse(args); if (!parsed.success) { return errorResult(parsed.error.errors.map((e) => e.message).join("; ")); } return handleToolCall(() => gatewayService.deleteGateway(client, parsed.data.gatewayId) ); } - Zod schema for delete_gateway input: requires a gatewayId (string, min 1 char).
const schema = z.object({ gatewayId: z.string().min(1, "gatewayId is required"), }); - Tool definition object with name 'delete_gateway', description, and JSON Schema input schema.
const definition = { name: "delete_gateway", description: "Delete a company gateway. DELETE /gateways/{gatewayId}. Fails if gateway is linked to company currencies or customers.", inputSchema: { type: "object" as const, properties: { gatewayId: { type: "string", description: "Gateway ID (required)" }, }, required: ["gatewayId"], }, }; - The actual HTTP call: client.delete() to /gateways/{gatewayId}.
export async function deleteGateway( client: Client, gatewayId: string ): Promise<unknown> { return client.delete<unknown>(`/gateways/${gatewayId}`); } - src/tools/gateways/index.ts:8-8 (registration)Import of deleteGatewayTool in the gateway tools index file.
import { deleteGatewayTool } from "./deleteGateway.js";