Skip to main content
Glama

list_gateways

Retrieve company payment gateways with optional filters by status, currency, or included attributes.

Instructions

List company gateways. GET /gateways. Optional: status (filter by active, disabled, error, archive), companyCurrencyId, include.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
statusNoFilter by status (e.g. active, disabled, error, archive)
companyCurrencyIdNoFilter by company currency ID
includeNoComma-separated attributes to include

Implementation Reference

  • Handler function that parses args with Zod schema, then calls gatewayService.listGateways(client, parsed.data). Returns result via handleToolCall wrapper.
    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.listGateways(client, parsed.data));
    }
  • Zod input validation schema defining optional fields: status, companyCurrencyId, include.
    const schema = z.object({
      status: z.string().optional(),
      companyCurrencyId: z.string().optional(),
      include: z.string().optional(),
    });
  • Tool object export combining definition and handler, registered as list_gateways.
    export const listGatewaysTool: Tool = {
      definition,
      handler,
    };
  • Core API function that builds query params and makes GET /gateways request via the client.
    export async function listGateways(
      client: Client,
      params?: ListGatewaysParams
    ): Promise<unknown> {
      const searchParams: string[] = [];
      if (params?.status) searchParams.push(`status=${encodeURIComponent(params.status)}`);
      if (params?.companyCurrencyId) {
        searchParams.push(`companyCurrencyId=${encodeURIComponent(params.companyCurrencyId)}`);
      }
      if (params?.include) searchParams.push(`include=${encodeURIComponent(params.include)}`);
      const q = searchParams.join("&");
      return client.get<unknown>(`/gateways${q ? `?${q}` : ""}`);
    }
  • handleToolCall utility that wraps async function calls, catching errors and returning success/error ToolResult.
    export async function handleToolCall<T>(fn: () => Promise<T>): Promise<ToolResult> {
      try {
        const data = await fn();
        return successResult(data);
      } catch (err) {
        const message = err instanceof Error ? err.message : String(err);
        return errorResult(`Error: ${message}`);
      }
    }
Behavior4/5

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

No annotations provided, so description carries full burden. It explicitly states the HTTP method (GET) implying a read operation, and lists optional query parameters. No contradictions.

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 with no unnecessary words. Purpose stated first, then parameters. Efficient and front-loaded.

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?

Given no annotations or output schema, description adequately covers purpose, endpoint, and parameters. Missing response format is acceptable for a list operation; overall complete for a simple GET.

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

Parameters4/5

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

Schema coverage is 100%. Description adds value by listing example filter values (active, disabled, error, archive) and clarifying that include is comma-separated, enhancing schema descriptions.

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?

Clearly states 'List company gateways' with the HTTP method 'GET /gateways'. Distinguishes from sibling tools like 'get_gateway' and 'list_global_gateways' by specifying company-level scope.

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?

Describes the tool's purpose but does not explicitly state when to use it versus alternatives like list_global_gateways or get_gateway. No when-not-to-use guidance.

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