Skip to main content
Glama

Create a check (BILLABLE + DRAWS FUNDS)

lob_checks_create
DestructiveIdempotent

Commit a check send to mail a physical check. Requires a verified bank account and recipient address; optionally preview and confirm in live mode.

Instructions

Commit a check send. HIGH IMPACT: incurs Lob fees AND draws the check amount from the linked bank account when cashed. Requires a verified bank account ID (bank_…). In live mode, requires a confirmation_token from lob_checks_preview that matches the current payload. If LOB_REQUIRE_ELICITATION_FOR_CHECKS_OVER_USD is set and amount exceeds it, an elicitation form must be confirmed by the user before dispatch.

For the bottom of the check page, Lob requires exactly one of message (plain text, max 400 chars) or check_bottom (custom template / HTML / PDF, typically paired with merge_variables).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
descriptionNoInternal description (max 255 chars).
toYesRecipient address. Either a saved address ID (`adr_…`) or an inline address.
fromYesSender (return) address. Either a saved address ID (`adr_…`) or an inline address.
send_dateNoISO 8601 timestamp (e.g. '2026-05-01T00:00:00Z') to schedule the send. Must be at most 180 days in the future.
mail_typeNoMail class. Defaults to usps_first_class for most pieces.
merge_variablesNoKey/value pairs substituted into Handlebars-style {{variables}} in your HTML/template content.
metadataNoUp to 20 string key/value pairs to attach to the resource.
billing_group_idNoBilling group ID (`bg_…`) to attribute the charge to.
use_typeNoRequired for some mail classes. 'marketing' for promotional, 'operational' for transactional.
bank_accountYesVerified Lob bank account ID.
amountYesCheck amount in USD (e.g. 125.50).
check_numberNoOptional check number; auto-assigned if omitted.
memoNoMemo line on the check (max 40 chars).
messageNoPlain-text message printed on the bottom of the check page (max 400 chars). Mutually exclusive with `check_bottom`.
check_bottomNoCustom artwork for the bottom half of the check page. Accepts a Lob template ID (`tmpl_…`), an HTML string, an https:// URL, or a base64 PDF. Mutually exclusive with `message`.
logoNoLogo printed on the check face (upper-left, grayscale; PNG or JPG).
attachmentNoSecondary document included in the envelope after the check page. Up to 6 pages.
idempotency_keyNoIdempotency key (max 256 chars). If omitted, the server auto-generates a value derived from the confirmation_token when present, otherwise a fresh UUIDv4. Lob deduplicates identical keys for 24 hours.
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.
confirmation_tokenNoToken from lob_checks_preview. Required in live mode (LOB_LIVE_MODE=true).

Implementation Reference

  • The tool 'lob_checks_create' is registered at line 150 in src/tools/checks.ts. It uses checkCommitShape as its input schema and pc.commit as its handler.
    registerTool(server, {
      name: "lob_checks_create",
      annotations: {
        title: "Create a check (BILLABLE + DRAWS FUNDS)",
        ...ToolAnnotationPresets.commit,
      },
      description:
        "Commit a check send. **HIGH IMPACT**: incurs Lob fees AND draws the check `amount` from the " +
        "linked bank account when cashed. Requires a verified bank account ID (`bank_…`). In live mode, " +
        "requires a `confirmation_token` from lob_checks_preview that matches the current payload. " +
        "If LOB_REQUIRE_ELICITATION_FOR_CHECKS_OVER_USD is set and `amount` exceeds it, an elicitation " +
        "form must be confirmed by the user before dispatch.\n\n" +
        "For the bottom of the check page, Lob requires exactly one of `message` (plain text, max 400 " +
        "chars) or `check_bottom` (custom template / HTML / PDF, typically paired with `merge_variables`).",
      inputSchema: checkCommitShape,
      handler: pc.commit,
    });
  • The actual handler for lob_checks_create is the 'commit' function returned by buildPreviewCommit (lines 90-142). This is the generic preview/commit factory used by all billable resources including checks.
    return {
      async preview(input) {
        const payload = stripUndefined(input as Record<string, unknown>);
        const previewResponse = await ctx.renderPreview(payload);
        const token = randomUUID();
        const now = Date.now();
        const ttlMs = Math.max(0, ctx.env.confirmationTtlSeconds * 1000);
        const record: PreviewRecord = {
          token,
          toolName: baseName,
          payloadHash: hashPayload(payload),
          payload,
          previewResponse,
          createdAt: now,
          expiresAt: now + ttlMs,
        };
        ctx.tokenStore.put(record);
        return {
          confirmation_token: token,
          expires_at: new Date(record.expiresAt).toISOString(),
          preview: previewResponse,
        };
      },
    
      async commit(input, serverCtx) {
        const inputAny = input as Record<string, unknown>;
        const confirmationToken = inputAny.confirmation_token as string | undefined;
        const explicitKey = inputAny.idempotency_key as string | undefined;
        const { confirmation_token: _t, idempotency_key: _i, ...rest } = inputAny;
        const payload = stripUndefined(rest);
    
        const requireToken =
          ctx.env.requireConfirmation && ctx.env.effectiveCommitMode === "live";
    
        let consumedToken: string | undefined;
        if (confirmationToken) {
          const record = ctx.tokenStore.consume(String(confirmationToken));
          if (!record) {
            throw new LobMcpError(
              LobMcpErrorCodes.TOKEN_NOT_FOUND,
              "Confirmation token not found, expired, or already consumed.",
              `Call ${baseName}_preview again to obtain a fresh token.`,
            );
          }
          if (hashPayload(payload) !== record.payloadHash) {
            throw new LobMcpError(
              LobMcpErrorCodes.TOKEN_PAYLOAD_MISMATCH,
              "Payload differs from the previewed payload.",
              `Call ${baseName}_preview again with the current parameters.`,
            );
          }
          consumedToken = record.token;
        } else if (requireToken) {
          throw new LobMcpError(
            LobMcpErrorCodes.TOKEN_REQUIRED,
            "Live mode requires a confirmation_token from the matching preview tool.",
            `Call ${baseName}_preview with the same parameters to obtain a token.`,
          );
        }
    
        const idempotencyKey =
          explicitKey ??
          (consumedToken ? `lob-mcp-${consumedToken}` : `lob-mcp-${randomUUID()}`);
    
        if (ctx.beforeDispatch) await ctx.beforeDispatch(payload, serverCtx);
    
        const result = await ctx.callCommit(payload, {
          idempotencyKey,
          confirmationToken: consumedToken,
        });
    
        return {
          idempotency_key_used: idempotencyKey,
          confirmation_token_consumed: consumedToken ?? null,
          result,
        };
      },
    };
  • Input schema for lob_checks_create, extending checkCreateShape with an optional confirmation_token. checkCreateShape (lines 35-76) includes bank_account, amount, check_number, memo, message, check_bottom, logo, attachment, idempotency_key, and extra fields.
    const checkCommitShape = {
      ...checkCreateShape,
      confirmation_token: z
        .string()
        .optional()
        .describe(
          "Token from lob_checks_preview. Required in live mode (LOB_LIVE_MODE=true).",
        ),
    } as const;
  • The buildPreviewCommit call that configures the lob_checks_create tool. It provides: (1) renderPreview — textual summary (no PDF), (2) beforeDispatch — piece counter check + optional elicitation for large amounts, and (3) callCommit — the actual POST /checks API call to Lob.
    const pc = buildPreviewCommit({
      baseName: "lob_checks",
      baseSchema: checkCreateShape,
      ctx: {
        env: lob.env,
        tokenStore,
        renderPreview: async (payload) => ({
          kind: "textual_preview",
          note:
            "Lob does not produce check proofs. This preview confirms validation only — no PDF is rendered. " +
            "The returned confirmation_token binds the payload: committing a different amount or recipient " +
            "will be rejected.",
          bank_account: payload.bank_account,
          amount_usd: payload.amount,
          check_number: payload.check_number ?? "auto-assigned",
          memo: payload.memo,
          design_spec: findSpec("check", "standard"),
        }),
        beforeDispatch: async (payload, serverCtx) => {
          pieceCounter.checkAndReserve(1);
          const threshold = lob.env.requireElicitationForChecksOverUsd;
          const amount = Number(payload.amount);
          if (threshold != null && amount > threshold) {
            await elicitOrFail(serverCtx as { mcpReq?: { elicitInput?: (req: unknown) => Promise<{ action: string; content?: unknown }> } } | undefined, {
              title: "Confirm large check",
              message:
                `About to commit a $${amount.toFixed(2)} check from bank account ${payload.bank_account}. ` +
                "This is irreversible: physical mail will be produced and the amount will be drawn from the linked account when cashed.",
            });
          }
        },
        callCommit: async (payload, { idempotencyKey }) => {
          const { extra, ...rest } = payload as Record<string, unknown>;
          const out = await lob.request({
            method: "POST",
            path: "/checks",
            body: withExtra(rest, extra as Record<string, unknown> | undefined),
            idempotencyKey,
          });
          pieceCounter.record(1);
          return out;
        },
      },
  • The /checks path is listed as a billable POST path, meaning the Lob client enforces idempotency-key requirements and uses the effective commit mode (live/test) for the request.
    const BILLABLE_POST_PATHS: RegExp[] = [
      /^\/postcards\b/,
      /^\/letters\b/,
      /^\/self_mailers\b/,
Behavior4/5

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

Beyond annotations (destructiveHint: true, idempotentHint: true), the description adds that it incurs fees, draws funds, requires confirmation_token, and an elicitation form condition. 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?

The description is two concise paragraphs. The first covers impact and prerequisites; the second clarifies bottom options. Every sentence is necessary and well-placed, with no redundancy.

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?

Given 20 parameters and full schema descriptions, the description covers the critical behavioral aspects (fees, validation, mutual exclusivity). It doesn't need to list all params; the schema does that. Additional output schema absence is not a gap here.

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?

With 100% schema coverage, the description adds value by explaining the message/check_bottom mutual exclusivity and confirming the idempotency key behavior. It also references the elicitation condition related to amount.

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 'Commit a check send' and highlights 'HIGH IMPACT' with financial implications, distinguishing it from sibling tools like lob_checks_cancel, lob_checks_get, etc. It also mentions the need for a verified bank account and confirmation token, which are key to its purpose.

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 provides explicit prerequisites (verified bank account, confirmation_token in live mode), an elicitation condition, and the mutual exclusivity of message/check_bottom. It doesn't explicitly compare to alternatives but implies this is the creation tool.

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