Skip to main content
Glama

Update a creative

lob_creatives_update
Idempotent

Update a creative's description or metadata by providing the creative ID and optional parameters.

Instructions

Update a creative's description or metadata.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesCreative ID (`crv_…`).
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

  • The handler function for lob_creatives_update. It destructures id and extra from args, then sends a PATCH request to /creatives/{id} with the remaining fields merged with extra via withExtra().
    handler: async (args) => {
      const { id, extra, ...rest } = args;
      return lob.request({
        method: "PATCH",
        path: `/creatives/${id}`,
        body: withExtra(rest, extra),
      });
    },
  • Input schema for lob_creatives_update: requires creative ID (crv_…), optional description (max 255 chars), optional metadata key/value pairs, and optional extra params escape hatch.
    inputSchema: {
      id: CREATIVE_ID,
      description: z.string().max(255).optional(),
      metadata: metadataSchema,
      extra: extraParamsSchema,
    },
  • Registration of the lob_creatives_update tool within the registerCampaignTools function. Called via registerAllTools in register.ts line 41.
    registerTool(server, {
      name: "lob_creatives_update",
      annotations: { title: "Update a creative", ...ToolAnnotationPresets.mutate },
      description: "Update a creative's description or metadata.",
      inputSchema: {
        id: CREATIVE_ID,
        description: z.string().max(255).optional(),
        metadata: metadataSchema,
        extra: extraParamsSchema,
      },
      handler: async (args) => {
        const { id, extra, ...rest } = args;
        return lob.request({
          method: "PATCH",
          path: `/creatives/${id}`,
          body: withExtra(rest, extra),
        });
      },
    });
  • Helper function used by the handler to merge extra params into the request body, with explicit typed fields taking precedence.
    export function withExtra(
      payload: object,
      extra: Record<string, unknown> | undefined,
    ): Record<string, unknown> {
      return { ...(extra ?? {}), ...compact(payload) };
    }
  • The generic registerTool helper that wraps handlers with consistent error handling and JSON formatting. Used to register lob_creatives_update onto 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 indicate the tool is read-write (readOnlyHint=false) and idempotent, but the description adds no further behavioral insight (e.g., about the 'extra' parameter or side effects).

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 a single, well-structured sentence with no wasted words, front-loading the key information (verb, resource, updated fields).

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?

For a simple update tool with no output schema, the description adequately covers the core functionality; it could mention the 'id' requirement and 'extra' parameter for completeness, but it remains sufficient.

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 coverage is high (75%): two parameters (description and metadata) are explicitly mentioned in the description, but 'id' and 'extra' are not elaborated beyond the schema. The description adds no new meaning beyond the schema.

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 action ('Update') and the resource ('a creative'), and specifies which attributes are updatable ('description or metadata'), distinguishing it from create/delete/get/list siblings.

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

Usage Guidelines3/5

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

The description provides minimal usage guidance; it does not explain when to use this tool versus other creative-related tools (e.g., create or delete) or mention prerequisites like requiring an existing creative ID.

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