delete_activity
Remove an activity post for the authorized user by specifying the AniList activity ID through the AniList MCP server.
Instructions
[Requires Login] Delete the current authorized user's activity post
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The AniList activity ID to delete |
Implementation Reference
- tools/activity.ts:26-50 (handler)The handler function that executes the delete_activity tool: performs authentication check, deletes the AniList activity by ID, and returns a text response indicating success or failure, or an error.async ({ id }) => { try { const auth = requireAuth(config.anilistToken); if (!auth.isAuthorized) { return auth.errorResponse; } const result = await anilist.activity.delete(id); return { content: [ { type: "text", text: result ? `Successfully deleted activity with ID ${id}.` : `Failed to delete activity with ID ${id}.`, }, ], }; } catch (error: any) { return { content: [{ type: "text", text: `Error: ${error.message}` }], isError: true, }; } },
- tools/activity.ts:16-25 (schema)Input schema requiring a numeric 'id' parameter and metadata hints indicating the tool is destructive but idempotent.{ id: z.number().describe("The AniList activity ID to delete"), }, { title: "Delete an AniList Activity", readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: true, },
- tools/activity.ts:13-51 (registration)The server.tool call that registers the delete_activity tool with its description, schema, metadata, and handler function within the registerActivityTools function.server.tool( "delete_activity", "[Requires Login] Delete the current authorized user's activity post", { id: z.number().describe("The AniList activity ID to delete"), }, { title: "Delete an AniList Activity", 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.activity.delete(id); return { content: [ { type: "text", text: result ? `Successfully deleted activity with ID ${id}.` : `Failed to delete activity with ID ${id}.`, }, ], }; } catch (error: any) { return { content: [{ type: "text", text: `Error: ${error.message}` }], isError: true, }; } }, );