Skip to main content
Glama

Bulk verify US addresses

lob_bulk_us_verifications_create
Read-onlyIdempotent

Verify up to 1,000 US addresses in a single request. Returns one result per input, preserving order.

Instructions

Verify up to 1,000 US addresses in a single request. Returns one verification result per input, in the same order.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressesYes
caseNo
extraNoAdditional Lob API parameters not enumerated above. Merged into the request body verbatim. See https://docs.lob.com for the full parameter list per resource.

Implementation Reference

  • The handler function for the lob_bulk_us_verifications_create tool. It extracts 'extra' from args, then makes a POST request to '/bulk/us_verifications' with the remaining arguments merged with extra params via withExtra().
    handler: async (args) => {
      const { extra, ...rest } = args;
      return lob.request({
        method: "POST",
        path: "/bulk/us_verifications",
        body: withExtra(rest, extra),
      });
    },
  • The full registration block for lob_bulk_us_verifications_create including input schema. The schema accepts addresses (array of 1-1000 objects matching usAddressInputSchema), an optional 'case' enum (upper/proper), and optional 'extra' record.
    registerTool(server, {
      name: "lob_bulk_us_verifications_create",
      annotations: { title: "Bulk verify US addresses", ...ToolAnnotationPresets.read },
      description:
        "Verify up to 1,000 US addresses in a single request. Returns one verification result per " +
        "input, in the same order.",
      inputSchema: {
        addresses: z.array(z.object(usAddressInputSchema).passthrough()).min(1).max(1000),
        case: z.enum(["upper", "proper"]).optional(),
        extra: extraParamsSchema,
      },
      handler: async (args) => {
        const { extra, ...rest } = args;
        return lob.request({
          method: "POST",
          path: "/bulk/us_verifications",
          body: withExtra(rest, extra),
        });
      },
    });
  • The tool is registered via registerTool() (from src/tools/helpers.ts) on the MCP server. registerTool wraps the handler with error handling and formats the result as JSON text content.
    registerTool(server, {
      name: "lob_bulk_us_verifications_create",
      annotations: { title: "Bulk verify US addresses", ...ToolAnnotationPresets.read },
      description:
        "Verify up to 1,000 US addresses in a single request. Returns one verification result per " +
        "input, in the same order.",
      inputSchema: {
        addresses: z.array(z.object(usAddressInputSchema).passthrough()).min(1).max(1000),
        case: z.enum(["upper", "proper"]).optional(),
        extra: extraParamsSchema,
      },
      handler: async (args) => {
        const { extra, ...rest } = args;
        return lob.request({
          method: "POST",
          path: "/bulk/us_verifications",
          body: withExtra(rest, extra),
        });
      },
    });
  • The registerTool helper function used to register all tools including lob_bulk_us_verifications_create. It wraps each tool's handler with try/catch error handling and formats results as JSON text content.
    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,
      );
    }
  • The withExtra helper function used in the handler to merge typed args with the extraparams escape hatch. The typed fields take precedence over extra values.
    /** Merge an `extra` record into a typed payload, with explicit fields taking precedence. */
    export function withExtra(
      payload: object,
      extra: Record<string, unknown> | undefined,
    ): Record<string, unknown> {
      return { ...(extra ?? {}), ...compact(payload) };
    }
Behavior4/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, idempotentHint=true. Description adds context about order preservation and one-to-one output, which is valuable and consistent. 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 sentences, front-loaded with key information (batch size and purpose), no extraneous text. Efficient.

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

Completeness2/5

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

No output schema, so description should describe return format beyond 'one verification result per input'. It omits details on result structure, possible error states, or pagination behavior. Incomplete for a batch tool.

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

Parameters2/5

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

Schema description coverage is 33% (low). Description adds no parameter details beyond what schema already provides. It does not explain the 'case' enum or the 'extra' object's purpose. Does not compensate for low coverage.

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 (verify), resource (US addresses), batch size (up to 1,000), and order preservation. It distinguishes from siblings like lob_us_verifications_create (single) and lob_bulk_intl_verifications_create (international).

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

Usage Guidelines2/5

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

No guidance on when to use this tool vs alternatives (e.g., lob_us_verifications_create for single address, or lob_bulk_intl_verifications_create). No prerequisites or exclusions mentioned.

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