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
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The AniList thread ID to delete |
Implementation Reference
- tools/thread.ts:26-51 (handler)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, }; } }, );
- tools/thread.ts:16-18 (schema)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, }; } }, );