Skip to main content
Glama

Delete a campaign

lob_campaigns_delete
DestructiveIdempotent

Delete a campaign using its ID before it has been sent. Removes the campaign from the system.

Instructions

Delete a campaign. Only allowed before send.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesCampaign ID (`cmp_…`).

Implementation Reference

  • Handler for lob_campaigns_delete: sends a DELETE request to /campaigns/{id}
    handler: async ({ id }) => lob.request({ method: "DELETE", path: `/campaigns/${id}` }),
  • Input schema for lob_campaigns_delete: requires a campaign ID matching the pattern cmp_*
    inputSchema: { id: CAMPAIGN_ID },
  • Registration of lob_campaigns_delete tool via registerTool utility
    registerTool(server, {
      name: "lob_campaigns_delete",
      annotations: { title: "Delete a campaign", ...ToolAnnotationPresets.destructive },
      description: "Delete a campaign. Only allowed before send.",
      inputSchema: { id: CAMPAIGN_ID },
      handler: async ({ id }) => lob.request({ method: "DELETE", path: `/campaigns/${id}` }),
    });
  • The registerTool helper that wraps handler logic with error handling and registers 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,
      );
    }
  • ToolAnnotationPresets.destructive used by lob_campaigns_delete annotation
    destructive: {
Behavior4/5

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

Annotations already set destructiveHint=true and idempotentHint=true. The description adds valuable behavioral context by specifying 'Only allowed before send,' which is not captured in annotations. No contradiction.

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 sentences with zero waste. Every word serves a purpose, making it highly efficient and easy to parse.

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 one-parameter destructive tool with annotations covering safety profiles, the description is complete, covering the essential constraint and purpose.

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 100% with a clear description for the single parameter. The tool description adds no additional parameter detail beyond what the schema provides, so baseline 3 is appropriate.

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 'Delete a campaign' and adds a crucial constraint 'Only allowed before send,' distinguishing it from siblings like create, get, list, and update.

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 clear context for when to use the tool (before send) but does not explicitly state when not to use it or mention alternatives, leaving some room for improvement.

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