Skip to main content
Glama

List bank accounts

lob_bank_accounts_list
Read-onlyIdempotent

List bank accounts from your Lob account with pagination, date, and metadata filters. Pass include: ['total_count'] with limit:1 to get total count efficiently.

Instructions

List bank accounts on your Lob account. For 'how many bank accounts?' counts, pass include: ['total_count'] with limit: 1.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoHow many results to return (default 10, max 100).
beforeNoCursor for the previous page.
afterNoCursor for the next page.
includeNoResponse add-ons. Pass ['total_count'] alongside any filters and limit:1 to answer 'how many?' questions in a single call — far cheaper than paginating to count. Not accepted on nested order endpoints (buckslip/card orders) or /webhooks.
date_createdNoISO8601 date filter object with gt/gte/lt/lte keys, e.g. { gt: '2026-04-23T00:00:00Z' } for 'last 7 days'. Combine with include:['total_count'] and limit:1 for date-bounded counts.
metadataNoFilter by metadata key/value pairs.

Implementation Reference

  • The handler function for lob_bank_accounts_list: performs a GET request to /bank_accounts with the list params passed as query parameters (with undefined values compacted out).
      handler: async (args) =>
        lob.request({ method: "GET", path: "/bank_accounts", query: compact(args) }),
    });
  • The input schema is spread from listParamsSchema.shape, which defines limit, before, after, include, date_created, and metadata fields (see src/schemas/common.ts lines 85-110).
    inputSchema: { ...listParamsSchema.shape },
  • Registration of lob_bank_accounts_list inside registerBankAccountTools, called from src/tools/register.ts line 43.
    registerTool(server, {
      name: "lob_bank_accounts_list",
      annotations: { title: "List bank accounts", ...ToolAnnotationPresets.read },
      description:
        "List bank accounts on your Lob account. **For 'how many bank accounts?' counts, pass " +
        "`include: ['total_count']` with `limit: 1`.**",
      inputSchema: { ...listParamsSchema.shape },
      handler: async (args) =>
        lob.request({ method: "GET", path: "/bank_accounts", query: compact(args) }),
    });
  • The compact helper removes undefined values from args before sending as query params to the Lob API.
    export function compact<T extends object>(obj: T): Partial<T> {
      const out: Record<string, unknown> = {};
      for (const [k, v] of Object.entries(obj)) {
        if (v !== undefined) out[k] = v;
      }
      return out as Partial<T>;
    }
  • The registerTool helper that wraps the tool's handler with error handling and consistent response formatting before registering with the MCP server.
    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 declare readOnlyHint=true, destructiveHint=false, idempotentHint=true, openWorldHint=true. The description adds a performance optimization tip (counting) but no behavioral traits beyond that. No contradiction with annotations.

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: one sentence immediately stating purpose, followed by a bold tip for a key use case. No wasted words, front-loaded.

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

Completeness5/5

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

For a simple list tool with good annotations and full schema coverage, the description covers purpose and a critical usage pattern. No output schema exists, but the tool's return is standard list format, so no further explanation needed.

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

Parameters4/5

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

Input schema has 100% coverage with descriptions for all parameters. The description adds valuable guidance on how to use the `include` parameter with `limit: 1` for efficient counting, going beyond the schema's description.

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 lists bank accounts on the Lob account, using a specific verb and resource. It distinguishes from sibling tools like create, delete, get, verify by focusing on listing.

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?

Provides explicit guidance for a common use case: counting bank accounts by using `include: ['total_count']` with `limit: 1`. However, it does not explicitly differentiate from using `get` for a single account or other filtering scenarios, but the context is clear enough.

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