Skip to main content
Glama

delete_tag

Remove tags from documents in Paperless-NGX by specifying the tag ID. Simplify document organization by eliminating unnecessary or outdated tags.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes

Implementation Reference

  • Full registration of the 'delete_tag' tool, including name, description, input schema (id and confirm), and handler function that checks confirmation and calls api.deleteTag
    server.tool(
      "delete_tag",
      "⚠️ DESTRUCTIVE: Permanently delete a tag from the entire system. This will remove the tag from ALL documents that use it. Use with extreme caution.",
      {
        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.deleteTag(args.id);
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify({ status: "deleted" }),
            },
          ],
        };
      })
    );
  • Executes the core logic: validates API connection and confirmation flag, deletes the tag via API, returns 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.deleteTag(args.id);
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify({ status: "deleted" }),
          },
        ],
      };
    })
  • Input schema using Zod: requires id (number) and confirm (boolean, must be true)
    {
      id: z.number(),
      confirm: z
        .boolean()
        .describe("Must be true to confirm this destructive operation"),
    },
  • Thin wrapper in PaperlessAPI client that sends DELETE request to /tags/{id}/
    async deleteTag(id: number): Promise<void> {
      return this.request<void>(`/tags/${id}/`, {
        method: "DELETE",
      });
    }
  • src/index.ts:70-70 (registration)
    Top-level call to register all tag tools, including delete_tag, on the MCP server
    registerTagTools(server, api);

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