Skip to main content
Glama

update_gateway

Update a payment gateway's display name or credentials by providing the gateway ID and optional display name or settings object.

Instructions

Update a company gateway. PUT /gateways/{gatewayId}. Optional: displayName, setting (credentials key-value object).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
gatewayIdYesGateway ID (required)
displayNameNoDisplay name
settingNoCredentials object (key-value). Keys depend on gateway type.

Implementation Reference

  • Handler function that parses args, extracts gatewayId/displayName/setting, and calls gatewayService.updateGateway.
    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("; "));
      }
      const { gatewayId, displayName, setting } = parsed.data;
      const body = { displayName, setting };
      return handleToolCall(() => gatewayService.updateGateway(client, gatewayId, body));
    }
  • Zod schema for update_gateway input validation: gatewayId (required), displayName (optional), setting (optional record).
    const settingSchema = z.record(z.union([z.string(), z.number(), z.boolean()])).optional();
    
    const schema = z.object({
      gatewayId: z.string().min(1, "gatewayId is required"),
      displayName: z.string().optional(),
      setting: settingSchema,
    });
  • Tool definition/input schema for update_gateway with name, description, and JSON Schema input properties.
    const definition = {
      name: "update_gateway",
      description:
        "Update a company gateway. PUT /gateways/{gatewayId}. Optional: displayName, setting (credentials key-value object).",
      inputSchema: {
        type: "object" as const,
        properties: {
          gatewayId: { type: "string", description: "Gateway ID (required)" },
          displayName: { type: "string", description: "Display name" },
          setting: {
            type: "object",
            description: "Credentials object (key-value). Keys depend on gateway type.",
          },
        },
        required: ["gatewayId"],
      },
    };
  • Import and export of updateGatewayTool; included in registerGatewayTools array at line 25.
    import { updateGatewayTool } from "./updateGateway.js";
    
    /** All gateway tools. */
    export function registerGatewayTools(): Tool[] {
      return [
        listGlobalGatewaysTool,
        listGatewaysTool,
        getGatewayTool,
        getClientTokenTool,
        createSetupIntentTool,
        createGatewayTool,
        updateGatewayTool,
        deleteGatewayTool,
        testGatewayTool,
      ];
    }
  • updateGateway service function that sends PUT /gateways/{gatewayId} with filtered body payload.
    /** PUT /gateways/{gatewayId} */
    export async function updateGateway(
      client: Client,
      gatewayId: string,
      body: UpdateGatewayBody
    ): Promise<unknown> {
      const payload = Object.fromEntries(
        Object.entries(body).filter(([, v]) => v !== undefined)
      ) as UpdateGatewayBody;
      return client.put<unknown>(`/gateways/${gatewayId}`, Object.keys(payload).length ? payload : {});
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, and the description does not disclose behavioral traits beyond 'update'. It lacks details on idempotency, required permissions, side effects, or return behavior, which is insufficient for a mutation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise with two sentences, front-loading the action and HTTP method. No unnecessary words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Missing information such as prerequisites (gateway must exist), behavior for unspecified fields, response format, and error handling. Given no output schema or annotations, the description is insufficiently complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Input schema has 100% description coverage, so the description adds minimal value by restating optionality of displayName and setting. Baseline 3 is appropriate as schema already documents parameters adequately.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action (update) and resource (gateway), and includes the HTTP method. It distinguishes this from sibling tools like create_gateway and delete_gateway.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives. It does not mention prerequisites, conditions, or exclusions, relying on the tool name to imply its use case.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/rhinosaas/rebillia-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server