Skip to main content
Glama

get_user_activity

Retrieve user activities from AniList by specifying the user ID, page number, and entries per page for streamlined activity tracking.

Instructions

Fetch activities from a user

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNoThe page number to display
perPageNoHow many entries to display on one page (max 25)
userYesThe user's AniList ID

Implementation Reference

  • The handler function that implements the core logic of the 'get_user_activity' tool by fetching activities for a given user using the AniList API and returning them as JSON or an error response.
    async ({ user, page, perPage }) => {
      try {
        const activities = await anilist.activity.getUserActivity(
          user,
          page,
          perPage,
        );
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(activities, null, 2),
            },
          ],
        };
      } catch (error: any) {
        return {
          content: [{ type: "text", text: `Error: ${error.message}` }],
          isError: true,
        };
      }
    },
  • The Zod input schema defining the parameters for the 'get_user_activity' tool: user (AniList ID), page (optional, default 1), perPage (optional, default 25, max 25).
    {
      user: z.number().describe("The user's AniList ID"),
      page: z
        .number()
        .optional()
        .default(1)
        .describe("The page number to display"),
      perPage: z
        .number()
        .optional()
        .default(25)
        .describe("How many entries to display on one page (max 25)"),
    },
  • The complete registration of the 'get_user_activity' tool within the registerActivityTools function using server.tool, including name, description, input schema, metadata hints, and handler.
    // anilist.activity.getUserActivity()
    server.tool(
      "get_user_activity",
      "Fetch activities from a user",
      {
        user: z.number().describe("The user's AniList ID"),
        page: z
          .number()
          .optional()
          .default(1)
          .describe("The page number to display"),
        perPage: z
          .number()
          .optional()
          .default(25)
          .describe("How many entries to display on one page (max 25)"),
      },
      {
        title: "Get a User's AniList Activities",
        readOnlyHint: true,
        openWorldHint: true,
      },
      async ({ user, page, perPage }) => {
        try {
          const activities = await anilist.activity.getUserActivity(
            user,
            page,
            perPage,
          );
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify(activities, null, 2),
              },
            ],
          };
        } catch (error: any) {
          return {
            content: [{ type: "text", text: `Error: ${error.message}` }],
            isError: true,
          };
        }
      },
    );
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states 'fetch activities' but doesn't describe what 'activities' entail, whether this is a read-only operation, if it requires authentication, or any rate limits or pagination behavior beyond what's implied by the schema. This leaves significant gaps for a tool that likely interacts with user data.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence ('Fetch activities from a user') with no wasted words. It's front-loaded and appropriately sized for the tool's purpose, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of fetching user activities, no annotations, and no output schema, the description is incomplete. It doesn't explain what 'activities' include (e.g., posts, likes, updates), the response format, or any behavioral aspects like error handling. This leaves the agent with insufficient context for reliable use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, with clear descriptions for all parameters (e.g., 'The user's AniList ID' for 'user'). The description adds no additional meaning beyond the schema, such as explaining what 'activities' are or how pagination works in practice. Baseline 3 is appropriate since the schema adequately documents the parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Fetch activities from a user' clearly states the verb ('fetch') and resource ('activities from a user'), making the purpose understandable. However, it doesn't distinguish this tool from sibling tools like 'get_activity' or 'get_user_recent_activity', which appear to serve similar functions, so it lacks sibling differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'get_activity' or 'get_user_recent_activity', nor does it specify any context, prerequisites, or exclusions for usage, leaving the agent with no direction on tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

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