Skip to main content
Glama

List webhooks

lob_webhooks_list
Read-onlyIdempotent

List webhook subscriptions on your account, with optional date and metadata filters, and paginate results using before/after cursors.

Instructions

List webhook subscriptions on your account. Note: Lob's /webhooks does NOT support include: ['total_count'] — for a count, just inspect data.length (webhook lists are small).

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 for lob_webhooks_list: makes a GET request to /webhooks with compacted query args (dropping undefined fields).
      handler: async (args) =>
        lob.request({ method: "GET", path: "/webhooks", query: compact(args) }),
    });
  • Input schema for lob_webhooks_list: spreads listParamsSchema.shape (limit, before, after, include, date_created, metadata).
    inputSchema: { ...listParamsSchema.shape },
  • Registration of lob_webhooks_list tool via registerTool() with name, annotations (read), description, inputSchema, and handler.
    registerTool(server, {
      name: "lob_webhooks_list",
      annotations: { title: "List webhooks", ...ToolAnnotationPresets.read },
      description:
        "List webhook subscriptions on your account. Note: Lob's `/webhooks` does NOT support " +
        "`include: ['total_count']` — for a count, just inspect `data.length` (webhook lists are small).",
      inputSchema: { ...listParamsSchema.shape },
      handler: async (args) =>
        lob.request({ method: "GET", path: "/webhooks", query: compact(args) }),
    });
  • The registerTool helper function that wraps the handler with consistent error handling and registers it 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,
      );
    }
  • listParamsSchema definition used as the input schema for lob_webhooks_list. Provides limit, before, after, include, date_created, metadata fields.
    export const listParamsSchema = z
      .object({
        limit: z
          .number()
          .int()
          .min(1)
          .max(100)
          .optional()
          .describe("How many results to return (default 10, max 100)."),
        before: z.string().optional().describe("Cursor for the previous page."),
        after: z.string().optional().describe("Cursor for the next page."),
        include: z
          .array(z.string())
          .optional()
          .describe(
            "Response 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_created: dateFilterSchema.optional(),
        metadata: z
          .record(z.string())
          .optional()
          .describe("Filter by metadata key/value pairs."),
      })
      .describe("Common Lob list/pagination parameters.");
Behavior5/5

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

Annotations already mark the tool as read-only, non-destructive, and idempotent. The description adds that webhook lists are small and that the 'total_count' parameter is not supported, disclosing non-obvious API limitations beyond the 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?

Two concise sentences: the first states the purpose, the second provides a critical caveat. No unnecessary words, and the key information is front-loaded.

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?

The description, combined with annotations and schema, gives sufficient context for a simple list tool. It lacks explicit mention of the return format (e.g., a list of webhook objects), but the agent can infer from the tool's purpose and parameters.

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?

Input schema has 100% coverage with detailed descriptions for all 6 parameters. The description's note about 'total_count' is already present in the schema's explanation of the 'include' parameter, so it adds no new parameter-level information. Baseline 3 applies.

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 'List webhook subscriptions on your account,' using a specific verb and resource. This distinguishes it from sibling tools like lob_webhooks_get or lob_webhooks_create, which have different purposes.

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 warns that 'include: ["total_count"]' is not supported and advises using 'data.length' instead. This gives clear when-to-use guidance for a common parameter, though it doesn't compare directly to siblings like list vs. get.

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