Skip to main content
Glama

Retrieve a saved address

lob_addresses_get
Read-onlyIdempotent

Retrieve a saved address by its unique ID to access its full details for use in mailing operations.

Instructions

Retrieve a single saved address by ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesLob address ID (`adr_…`).

Implementation Reference

  • The handler function for lob_addresses_get — makes a GET request to /addresses/{id} via the LobClient, returning the saved address data.
    handler: async ({ id }) => lob.request({ method: "GET", path: `/addresses/${id}` }),
  • The input schema for lob_addresses_get — accepts a single 'id' parameter validated to match the pattern /^adr_/ (Lob address ID format).
    inputSchema: { id: z.string().regex(/^adr_/).describe("Lob address ID (`adr_…`).") },
  • The registration of lob_addresses_get via the registerTool helper within registerAddressBookTools. Uses ToolAnnotationPresets.read (readOnlyHint, idempotent, non-destructive).
    registerTool(server, {
      name: "lob_addresses_get",
      annotations: { title: "Retrieve a saved address", ...ToolAnnotationPresets.read },
      description: "Retrieve a single saved address by ID.",
      inputSchema: { id: z.string().regex(/^adr_/).describe("Lob address ID (`adr_…`).") },
      handler: async ({ id }) => lob.request({ method: "GET", path: `/addresses/${id}` }),
    });
  • The registerTool helper function that wraps the SDK's server.registerTool with consistent error handling and JSON content formatting. Used by all tool registrations including lob_addresses_get.
    export function registerTool<TShape extends ZodRawShape>(
      server: McpServer,
      def: ToolDefinition<TShape>,
    ): void {
      const a = def.annotations ?? {};
      server.registerTool(
        def.name,
        {
          title: a.title ?? def.name,
          description: def.description,
          inputSchema: def.inputSchema,
          annotations: {
            ...a,
            // Lob is always external; default the hint accordingly.
            openWorldHint: a.openWorldHint ?? true,
          },
        },
        // The SDK's ToolCallback type is parameterised over the exact ZodRawShape and
        // resists the generic erasure here. The runtime contract (validated args in,
        // CallToolResult out) is correct, so we bridge the type boundary with `as never`.
        (async (args: unknown, serverCtx: unknown): Promise<CallToolResult> => {
          try {
            const result = await def.handler(args as never, serverCtx);
            return { content: [{ type: "text", text: stringifyResult(result) }] };
          } catch (err) {
            return {
              isError: true,
              content: [{ type: "text", text: formatErrorForTool(err) }],
            };
          }
        }) as never,
      );
    }
Behavior3/5

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

Annotations already provide readOnlyHint=true and destructiveHint=false, covering safety. The description adds no beyond-schema behavioral context (e.g., rate limits, auth needs), so it is adequate but not additive.

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?

A single 8-word sentence stating the exact purpose; every word contributes, no filler.

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?

For a simple one-parameter retrieval tool with no output schema but rich annotations, the description is nearly sufficient; it could optionally mention the return format but is not incomplete.

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% and the description does not elaborate on the parameter beyond what the schema already states, so it meets the baseline but adds no extra meaning.

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 specifies the verb 'Retrieve', the resource 'saved address', and the method 'by ID', making it distinct from sibling tools like list, create, and delete.

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 you have an address ID, but does not explicitly state when to use it versus alternatives (e.g., list for multiple addresses), lacking guidance on context.

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/optimize-overseas/lob-mcp'

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