post_text_activity
Create or update AniList text activities by submitting activity content and ID. Requires login for authorized access to the anilist-mcp server.
Instructions
[Requires Login] Post a new text activity or update an existing one
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | AniList Activity ID (null to create new, number to update) | |
| text | Yes | The content of the activity |
Implementation Reference
- tools/activity.ts:205-227 (handler)Handler function that authenticates the user, calls anilist.activity.postText(text, id), and returns the result or error.async ({ text, id }) => { try { const auth = requireAuth(config.anilistToken); if (!auth.isAuthorized) { return auth.errorResponse; } const result = await anilist.activity.postText(text, id); return { content: [ { type: "text", text: JSON.stringify(result, null, 2), }, ], }; } catch (error: any) { return { content: [{ type: "text", text: `Error: ${error.message}` }], isError: true, }; } },
- tools/activity.ts:191-197 (schema)Zod input schema defining parameters: text (string) and id (nullable number).{ text: z.string().describe("The content of the activity"), id: z .number() .nullable() .describe("AniList Activity ID (null to create new, number to update)"), },
- tools/activity.ts:188-228 (registration)Registration of the post_text_activity tool via server.tool(), including name, description, input schema, metadata hints, and inline handler.server.tool( "post_text_activity", "[Requires Login] Post a new text activity or update an existing one", { text: z.string().describe("The content of the activity"), id: z .number() .nullable() .describe("AniList Activity ID (null to create new, number to update)"), }, { title: "Post or Update an AniList Text Activity", readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: true, }, async ({ text, id }) => { try { const auth = requireAuth(config.anilistToken); if (!auth.isAuthorized) { return auth.errorResponse; } const result = await anilist.activity.postText(text, id); return { content: [ { type: "text", text: JSON.stringify(result, null, 2), }, ], }; } catch (error: any) { return { content: [{ type: "text", text: `Error: ${error.message}` }], isError: true, }; } }, );