get_gateway
Retrieve a specific payment gateway by its unique ID. Access detailed gateway information for your company's billing operations.
Instructions
Get a company gateway by ID. GET /gateways/{gatewayId}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| gatewayId | Yes | Gateway ID (required) |
Implementation Reference
- src/tools/gateways/getGateway.ts:23-31 (handler)Handler function that parses input args (validates gatewayId with Zod schema) and calls gatewayService.getGateway(client, gatewayId) to fetch a gateway by ID.
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.getGateway(client, parsed.data.gatewayId) ); } - src/tools/gateways/getGateway.ts:7-9 (schema)Zod schema defining the input: a required 'gatewayId' string (min length 1).
const schema = z.object({ gatewayId: z.string().min(1, "gatewayId is required"), }); - src/tools/gateways/getGateway.ts:11-21 (registration)Tool definition with name 'get_gateway', description, and JSON Schema input (gatewayId required string).
const definition = { name: "get_gateway", description: "Get a company gateway by ID. GET /gateways/{gatewayId}.", inputSchema: { type: "object" as const, properties: { gatewayId: { type: "string", description: "Gateway ID (required)" }, }, required: ["gatewayId"], }, }; - src/tools/gateways/index.ts:16-29 (registration)Registration in registerGatewayTools() which collects all gateway tools including getGatewayTool.
/** All gateway tools. */ export function registerGatewayTools(): Tool[] { return [ listGlobalGatewaysTool, listGatewaysTool, getGatewayTool, getClientTokenTool, createSetupIntentTool, createGatewayTool, updateGatewayTool, deleteGatewayTool, testGatewayTool, ]; } - Service function that makes the actual API call: client.get('/gateways/{gatewayId}').
/** GET /gateways/{gatewayId} */ export async function getGateway( client: Client, gatewayId: string ): Promise<unknown> { return client.get<unknown>(`/gateways/${gatewayId}`); }