Skip to main content
Glama

get_customer_address

Retrieve a single address book entry for a customer using customer ID and address ID.

Instructions

Get a single address book entry by ID. GET /customers/{customerId}/addressbooks/{addressId}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
customerIdYesCustomer ID (required)
addressIdYesAddress book entry ID (required)

Implementation Reference

  • The handler function that executes the tool logic: parses the Zod-validated arguments (customerId, addressId) and delegates to customerServices.getCustomerAddress().
    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, addressId } = parsed.data;
      return handleToolCall(() => customerService.getCustomerAddress(client, customerId, addressId));
    }
  • Zod schema validating that customerId and addressId are non-empty strings.
    const schema = z.object({
      customerId: z.string().min(1, "customerId is required"),
      addressId: z.string().min(1, "addressId is required"),
    });
  • Registration of getCustomerAddressTool in the customer tools array returned by registerCustomerTools().
    export function registerCustomerTools(): Tool[] {
      return [
        listCustomersTool,
        getCustomerTool,
        createCustomerTool,
        updateCustomerTool,
        deleteCustomerTool,
        getCustomerInvoicesTool,
        getCustomerUnpaidInvoicesTool,
        getCustomerSubscriptionsTool,
        getCustomerLogsTool,
        listCustomerAddressesTool,
        getCustomerAddressTool,
        createCustomerAddressTool,
        updateCustomerAddressTool,
        deleteCustomerAddressTool,
        listCustomerPaymentMethodsTool,
        getCustomerPaymentMethodTool,
        createCustomerPaymentMethodTool,
        updateCustomerPaymentMethodTool,
        deleteCustomerPaymentMethodTool,
        listCustomerChargesCreditsTool,
        createCustomerChargeCreditTool,
        deleteCustomerChargeCreditTool,
      ];
    }
  • Service function that performs the actual HTTP GET request to /customers/{customerId}/addressbooks/{addressId}.
    export async function getCustomerAddress(
      client: Client,
      customerId: string,
      addressId: string
    ): Promise<CustomerAddressBook> {
      return client.get<CustomerAddressBook>(
        `/customers/${customerId}/addressbooks/${addressId}`
      );
    }
  • MCP tool definition including name 'get_customer_address', description, and JSON Schema input schema.
    const definition = {
      name: "get_customer_address",
      description:
        "Get a single address book entry by ID. GET /customers/{customerId}/addressbooks/{addressId}.",
      inputSchema: {
        type: "object" as const,
        properties: {
          customerId: { type: "string", description: "Customer ID (required)" },
          addressId: { type: "string", description: "Address book entry ID (required)" },
        },
        required: ["customerId", "addressId"],
      },
    };
Behavior2/5

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

No annotations exist, so the description must bear the burden. It only indicates a GET read operation via the endpoint, lacking details on error handling, authentication, or idempotency.

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, each serving a purpose: function and endpoint. No redundant information.

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?

Adequate for a simple get-by-ID tool, but could mention return value expectations or error scenarios, especially given no output schema.

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

Parameters5/5

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

The description adds the HTTP endpoint path, clarifying parameter relationships beyond the schema's field names and 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?

The description clearly states the tool retrieves a single address book entry by ID, distinguishing it from list, create, update, delete siblings.

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?

The description implies usage when a specific address ID is known, but provides no explicit guidance on when to use alternatives like list_customer_addresses.

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