Skip to main content
Glama

Delete a saved address

lob_addresses_delete
DestructiveIdempotent

Delete a saved address from the address book without affecting existing mail pieces.

Instructions

Delete a saved address from the address book. Does not affect mail pieces already created with it.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesLob address ID to delete.

Implementation Reference

  • Tool definition and handler for 'lob_addresses_delete'. Registers the tool with a destructive annotation, validates input with a Zod schema (id matching /^adr_/), and makes a DELETE /addresses/{id} request via LobClient.
    registerTool(server, {
      name: "lob_addresses_delete",
      annotations: {
        title: "Delete a saved address",
        ...ToolAnnotationPresets.destructive,
      },
      description:
        "Delete a saved address from the address book. Does not affect mail pieces already created with it.",
      inputSchema: { id: z.string().regex(/^adr_/).describe("Lob address ID to delete.") },
      handler: async ({ id }) => lob.request({ method: "DELETE", path: `/addresses/${id}` }),
    });
  • Imports registerTool and ToolAnnotationPresets from helpers.js, used to register the tool.
    import { ToolAnnotationPresets, registerTool } from "./helpers.js";
  • The function registerAddressBookTools is called from src/tools/register.ts (line 34) to wire all address-book tools into the MCP server.
    export function registerAddressBookTools(server: McpServer, lob: LobClient): void {
  • The registerTool helper function that wraps SDK server.registerTool with consistent error handling and JSON formatting.
    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 including the 'destructive' preset used by lob_addresses_delete.
    export const ToolAnnotationPresets = {
      read: {
        readOnlyHint: true,
        destructiveHint: false,
        idempotentHint: true,
        openWorldHint: true,
      },
      preview: {
        readOnlyHint: false,
        destructiveHint: false,
        idempotentHint: true,
        openWorldHint: true,
      },
      commit: {
        readOnlyHint: false,
        destructiveHint: true,
        idempotentHint: true,
        openWorldHint: true,
      },
      destructive: {
        readOnlyHint: false,
        destructiveHint: true,
        idempotentHint: true,
        openWorldHint: true,
      },
      mutate: {
        readOnlyHint: false,
        destructiveHint: false,
        idempotentHint: true,
        openWorldHint: true,
      },
    } as const;
Behavior5/5

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

Annotations indicate destructiveHint=true and readOnlyHint=false; the description reinforces this by saying 'delete'. It adds valuable context that existing mail pieces are unaffected, which is 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, no fluff. The purpose is front-loaded, and the second sentence provides critical non-effect information.

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 delete tool with no output schema, the description is complete. It explains the action, what is affected, and what is not. No gaps.

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?

Only one parameter (id) is fully described in the input schema with pattern and description. The description does not add extra parameter-level details beyond what the schema provides, which is acceptable given 100% schema coverage.

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 deletes a saved address, distinguishing it from create/get/list siblings. It also adds important nuance: it does not affect already created mail pieces.

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?

Explicitly states when to use (delete a saved address) and provides a key exclusion (does not affect existing mail pieces). Lacks explicit alternatives but is sufficient for a simple delete operation.

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