Skip to main content
Glama

delete_correspondent

Remove correspondents from your Paperless-NGX instance by specifying their unique ID. This tool simplifies document management by enabling precise control over correspondent data.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes

Implementation Reference

  • The handler function for the delete_correspondent tool. It validates confirmation, calls the API to delete the correspondent, and returns a success status.
    withErrorHandling(async (args, extra) => {
      if (!api) throw new Error("Please configure API connection first");
      if (!args.confirm) {
        throw new Error(
          "Confirmation required for destructive operation. Set confirm: true to proceed."
        );
      }
      await api.deleteCorrespondent(args.id);
      return {
        content: [
          { type: "text", text: JSON.stringify({ status: "deleted" }) },
        ],
      };
    })
  • Input schema and description for the delete_correspondent tool, requiring id and confirm flag.
    "delete_correspondent",
    "⚠️ DESTRUCTIVE: Permanently delete a correspondent from the entire system. This will affect ALL documents that use this correspondent.",
    {
      id: z.number(),
      confirm: z
        .boolean()
        .describe("Must be true to confirm this destructive operation"),
    },
  • Registration of the delete_correspondent tool using server.tool, including schema and handler.
    server.tool(
      "delete_correspondent",
      "⚠️ DESTRUCTIVE: Permanently delete a correspondent from the entire system. This will affect ALL documents that use this correspondent.",
      {
        id: z.number(),
        confirm: z
          .boolean()
          .describe("Must be true to confirm this destructive operation"),
      },
      withErrorHandling(async (args, extra) => {
        if (!api) throw new Error("Please configure API connection first");
        if (!args.confirm) {
          throw new Error(
            "Confirmation required for destructive operation. Set confirm: true to proceed."
          );
        }
        await api.deleteCorrespondent(args.id);
        return {
          content: [
            { type: "text", text: JSON.stringify({ status: "deleted" }) },
          ],
        };
      })
    );
  • Supporting API method that sends DELETE request to the Paperless server to remove the correspondent.
    async deleteCorrespondent(id: number): Promise<void> {
      return this.request<void>(`/correspondents/${id}/`, {
        method: "DELETE",
      });
    }

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/baruchiro/paperless-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server