Skip to main content
Glama

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
NameRequiredDescriptionDefault
idYesThe AniList activity ID to delete

Implementation Reference

  • 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,
        };
      }
    },
  • 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,
    },
  • 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,
          };
        }
      },
    );

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