Skip to main content
Glama

get_customer_payment_method

Retrieve a specific payment method for a customer by providing the customer ID and payment method ID.

Instructions

Get a single payment method by ID. GET /customers/{customerId}/paymentmethods/{paymentMethodId}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
customerIdYesCustomer ID (required)
paymentMethodIdYesPayment method ID (required)

Implementation Reference

  • Handler function that validates inputs with Zod schema, then calls customerService.getCustomerPaymentMethod to fetch a payment method by customer ID and payment method 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("; "));
      }
      const { customerId, paymentMethodId } = parsed.data;
      return handleToolCall(() =>
        customerService.getCustomerPaymentMethod(client, customerId, paymentMethodId)
      );
    }
  • Zod schema defining required inputs: customerId (string) and paymentMethodId (string).
    const schema = z.object({
      customerId: z.string().min(1, "customerId is required"),
      paymentMethodId: z.string().min(1, "paymentMethodId is required"),
    });
  • Tool definition including name 'get_customer_payment_method', description, and JSON Schema input format.
    const definition = {
      name: "get_customer_payment_method",
      description:
        "Get a single payment method by ID. GET /customers/{customerId}/paymentmethods/{paymentMethodId}.",
      inputSchema: {
        type: "object" as const,
        properties: {
          customerId: { type: "string", description: "Customer ID (required)" },
          paymentMethodId: { type: "string", description: "Payment method ID (required)" },
        },
        required: ["customerId", "paymentMethodId"],
      },
    };
  • Export of the Tool object combining definition and handler, registered in the customer tools index.
    export const getCustomerPaymentMethodTool: Tool = {
      definition,
      handler,
    };
  • Service function that makes the actual GET /customers/{customerId}/paymentmethods/{paymentMethodId} API call.
    export async function getCustomerPaymentMethod(
      client: Client,
      customerId: string,
      paymentMethodId: string
    ): Promise<CustomerPaymentMethod> {
      return client.get<CustomerPaymentMethod>(
        `/customers/${customerId}/paymentmethods/${paymentMethodId}`
      );
    }
Behavior3/5

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

Indicates a read-only GET operation, implying no side effects, but provides no additional behavioral details such as error handling, rate limits, or authentication requirements. Annotations are absent, so description carries the burden.

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?

Extremely concise: a single sentence plus the HTTP path. No wasted words; every part adds value.

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

Completeness3/5

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

Adequate for a simple GET operation with two parameters. However, lacks mention of return value (e.g., payment method object) or example response. No output schema to compensate, so description could be more 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?

Schema coverage is 100% with descriptions for both parameters. The description adds the path format which slightly clarifies their roles, but the schema already identifies them as required IDs. No extra semantic detail beyond what the schema provides.

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 'Get a single payment method by ID' and includes the exact HTTP path, distinguishing it from siblings like list_customer_payment_methods (which returns multiple) and create/update/delete operations.

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?

Implied usage by naming and path (use when you have a customer ID and payment method ID), but no explicit guidance on when not to use or comparison to alternatives like list or other GET operations.

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