Skip to main content
Glama

Create a bank account

lob_bank_accounts_create
Idempotent

Register a US bank account to draw checks. Provide routing number, account number, account type, and signatory. Verify the account before use in check creation.

Instructions

Register a bank account that can be used to draw checks. Requires routing number, account number, account type, and signatory. Bank accounts must be verified (lob_bank_accounts_verify) before use in lob_checks_create.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
routing_numberYes9-digit US routing number.
account_numberYesAccount number.
account_typeYes
signatoryYesName of authorized signer printed on checks.
descriptionNo
metadataNoUp to 20 string key/value pairs of arbitrary metadata to attach to the resource.
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

  • Handler function for lob_bank_accounts_create: makes a POST request to /bank_accounts with validated args (routing_number, account_number, account_type, signatory, optional description/metadata/extra). Sends the request via LobClient.
    registerTool(server, {
      name: "lob_bank_accounts_create",
      annotations: { title: "Create a bank account", ...ToolAnnotationPresets.mutate },
      description:
        "Register a bank account that can be used to draw checks. Requires routing number, account " +
        "number, account type, and signatory. Bank accounts must be verified (`lob_bank_accounts_verify`) " +
        "before use in `lob_checks_create`.",
      inputSchema: {
        routing_number: z.string().regex(/^\d{9}$/).describe("9-digit US routing number."),
        account_number: z.string().describe("Account number."),
        account_type: z.enum(["company", "individual"]),
        signatory: z.string().max(100).describe("Name of authorized signer printed on checks."),
        description: z.string().max(255).optional(),
        metadata: metadataSchema,
        extra: extraParamsSchema,
      },
      handler: async (args) => {
        const { extra, ...rest } = args;
        return lob.request({
          method: "POST",
          path: "/bank_accounts",
          body: withExtra(rest, extra),
        });
      },
    });
  • Zod input schema for lob_bank_accounts_create: routing_number (9-digit regex), account_number (string), account_type (enum: company/individual), signatory (max 100 chars), description (max 255, optional), metadata (optional key-value record), extra (optional escape hatch for unlisted Lob API params).
    inputSchema: {
      routing_number: z.string().regex(/^\d{9}$/).describe("9-digit US routing number."),
      account_number: z.string().describe("Account number."),
      account_type: z.enum(["company", "individual"]),
      signatory: z.string().max(100).describe("Name of authorized signer printed on checks."),
      description: z.string().max(255).optional(),
      metadata: metadataSchema,
      extra: extraParamsSchema,
    },
  • Registration: registerBankAccountTools is called from registerAllTools, which wires all resource-group tools into the MCP server.
    registerBankAccountTools(server, lob);
  • The registerTool helper wraps the SDK's server.registerTool with consistent error handling. Catches handler errors and returns them as isError tool results.
    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 merges the typed payload with the extra escape-hatch params, with typed 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 indicate idempotentHint=true and openWorldHint=true. The description adds value by explaining the purpose (draw checks) and the mandatory verification step, which are not obvious from annotations. 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?

The description is two sentences, front-loaded with purpose and requirements, followed by critical usage guidance. No redundancy or 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?

Despite lacking output schema, the description covers the tool's role in the verification-check workflow. It omits mention of optional parameters like metadata and extra, but these are documented in the schema. The agent can piece together the full context.

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 description coverage is 71%, and the description merely lists required fields ('routing number, account number, account type, and signatory') already present in the schema. It adds no additional semantic meaning beyond restating requirements.

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 'Register a bank account that can be used to draw checks', providing a specific verb and resource. It differentiates from sibling tools like lob_bank_accounts_delete, lob_bank_accounts_get, and lob_bank_accounts_verify by mentioning the verification and usage for checks.

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

Usage Guidelines4/5

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

The description explicitly advises that bank accounts must be verified before use in lob_checks_create, giving clear context on the workflow. However, it does not state when not to use this tool or mention alternatives for other resources.

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