Skip to main content
Glama

delete_thread

Remove an AniList thread by its ID using the anilist-mcp server. Requires login to delete unwanted or outdated discussions.

Instructions

[Requires Login] Delete a thread by its ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe AniList thread ID to delete

Implementation Reference

  • The async handler function for the 'delete_thread' tool. It requires authentication using requireAuth, calls anilist.thread.delete(id), handles the result, and returns a structured content response with success or error messages.
      async ({ id }) => {
        try {
          const auth = requireAuth(config.anilistToken);
          if (!auth.isAuthorized) {
            return auth.errorResponse;
          }
    
          const result = await anilist.thread.delete(id);
          return {
            content: [
              {
                type: "text",
                text: result
                  ? `Successfully deleted thread with ID ${id}.`
                  : `Failed to delete thread with ID ${id}.`,
              },
            ],
          };
        } catch (error: any) {
          return {
            content: [{ type: "text", text: `Error: ${error.message}` }],
            isError: true,
          };
        }
      },
    );
  • Zod input schema for the 'delete_thread' tool, defining the required 'id' parameter as a number with description.
    {
      id: z.number().describe("The AniList thread ID to delete"),
    },
  • tools/thread.ts:13-51 (registration)
    Registration of the 'delete_thread' MCP tool using server.tool(), including name, description, input schema, tool hints (destructive, idempotent, etc.), and inline handler implementation.
    server.tool(
      "delete_thread",
      "[Requires Login] Delete a thread by its ID",
      {
        id: z.number().describe("The AniList thread ID to delete"),
      },
      {
        title: "Delete AniList Thread",
        readOnlyHint: false,
        destructiveHint: true,
        idempotentHint: true,
        openWorldHint: true,
      },
      async ({ id }) => {
        try {
          const auth = requireAuth(config.anilistToken);
          if (!auth.isAuthorized) {
            return auth.errorResponse;
          }
    
          const result = await anilist.thread.delete(id);
          return {
            content: [
              {
                type: "text",
                text: result
                  ? `Successfully deleted thread with ID ${id}.`
                  : `Failed to delete thread with ID ${id}.`,
              },
            ],
          };
        } catch (error: any) {
          return {
            content: [{ type: "text", text: `Error: ${error.message}` }],
            isError: true,
          };
        }
      },
    );

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/yuna0x0/anilist-mcp'

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