Skip to main content
Glama

test_gateway

Test a gateway connection by providing its ID. Returns the gateway object with its connection status, such as active on success.

Instructions

Test gateway connection. GET /gateways/{gatewayId}/test. Returns the gateway object with connection status (e.g. status active on success).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
gatewayIdYesGateway ID (required)

Implementation Reference

  • The handler function that executes the test_gateway tool logic. It validates args using a Zod schema (requiring gatewayId), then calls gatewayService.testGateway(client, gatewayId) which performs a GET /gateways/{gatewayId}/test request.
    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.testGateway(client, parsed.data.gatewayId)
      );
    }
  • Zod schema for input validation (gatewayId required string) and the MCP ToolDefinition (name: test_gateway, description, inputSchema with a single required gatewayId string property).
    const schema = z.object({
      gatewayId: z.string().min(1, "gatewayId is required"),
    });
    
    const definition = {
      name: "test_gateway",
      description:
        "Test gateway connection. GET /gateways/{gatewayId}/test. Returns the gateway object with connection status (e.g. status active on success).",
      inputSchema: {
        type: "object" as const,
        properties: {
          gatewayId: { type: "string", description: "Gateway ID (required)" },
        },
        required: ["gatewayId"],
      },
    };
  • testGatewayTool is imported from './testGateway.js' and included in the registerGatewayTools() array (line 27), which is called from src/tools/index.ts (line 35) via registerGatewayTools() to register all gateway tools.
    import { testGatewayTool } from "./testGateway.js";
    import { updateGatewayTool } from "./updateGateway.js";
    
    /** All gateway tools. */
    export function registerGatewayTools(): Tool[] {
      return [
        listGlobalGatewaysTool,
        listGatewaysTool,
        getGatewayTool,
        getClientTokenTool,
        createSetupIntentTool,
        createGatewayTool,
        updateGatewayTool,
        deleteGatewayTool,
        testGatewayTool,
      ];
    }
  • The underlying service function that performs the actual HTTP GET request to /gateways/{gatewayId}/test to test the gateway connection.
    export async function testGateway(
      client: Client,
      gatewayId: string
    ): Promise<unknown> {
      return client.get<unknown>(`/gateways/${gatewayId}/test`);
    }
  • The handleToolCall helper (used by the handler) that wraps the service call in try/catch, returning successResult on success or errorResult on failure.
    }
    
    export function successResult(data: unknown): ToolResult {
      return {
        content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }],
      };
    }
    
    export async function handleToolCall<T>(fn: () => Promise<T>): Promise<ToolResult> {
Behavior3/5

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

Without annotations, the description only reveals the endpoint and return format. It lacks details on side effects (if any), safety (read-only? destructive?), and error conditions.

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?

Two concise sentences that front-load the purpose and provide immediate value. No unnecessary words.

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

Completeness4/5

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

The description is mostly complete for a simple test tool: it specifies the endpoint, return type, and an example status. Missing possible error responses, but overall sufficient given the low complexity.

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?

The description adds no extra meaning to the single parameter beyond the schema's description. Schema coverage is 100%, so baseline 3 applies.

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 verb 'Test', the resource 'gateway connection', and specifies the HTTP method 'GET'. It distinguishes from sibling tools like get_gateway and create_gateway by focusing on testing connectivity.

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

Usage Guidelines3/5

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

Usage is implied (testing connection status) but no explicit guidance on when to use this vs alternatives like get_gateway, nor any exclusions or prerequisites.

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