Skip to main content
Glama

search_activity

Search and filter AniList activity data by ID, user, media, type, or creation date, enabling precise retrieval of user interactions and content updates.

Instructions

Search for activities on AniList

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
activityIDNoThe activity ID to lookup (leave it as undefined for no specific ID)
filterNoFilter object for searching activities (leave it as undefined for no specific filter)
pageNoPage number for results
perPageNoResults per page (max 25)

Implementation Reference

  • Executes the tool logic by searching for activities using the AniList client and returning JSON-formatted results or an error message.
    async ({ activityID, filter, page, perPage }) => {
      try {
        const results = await anilist.searchEntry.activity(
          activityID,
          filter,
          page,
          perPage,
        );
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(results, null, 2),
            },
          ],
        };
      } catch (error: any) {
        return {
          content: [{ type: "text", text: `Error: ${error.message}` }],
          isError: true,
        };
      }
    },
  • Input schema for the search_activity tool parameters using Zod.
    {
      activityID: z
        .number()
        .optional()
        .describe(
          "The activity ID to lookup (leave it as undefined for no specific ID)",
        ),
      filter: ActivityFilterTypesSchema.optional().describe(
        "Filter object for searching activities (leave it as undefined for no specific filter)",
      ),
      page: z
        .number()
        .optional()
        .default(1)
        .describe("Page number for results"),
      perPage: z
        .number()
        .optional()
        .default(5)
        .describe("Results per page (max 25)"),
    },
  • Zod schema definition for ActivityFilterTypesSchema, used as the type for the 'filter' parameter in search_activity.
    export const ActivityFilterTypesSchema = z.object({
      id: z.number().optional().describe("The id of the activity"),
      userId: z
        .number()
        .optional()
        .describe("The userID of the account with the activity"),
      messengerId: z.number().optional().describe("The ID of who sent the message"),
      mediaId: z.number().optional().describe("The ID of the media"),
      type: ActivityTypeSchema.optional().describe("The type of activity"),
      isFollowing: z
        .boolean()
        .optional()
        .describe(
          "[Requires Login] Filter users by who is following the authorized user",
        ),
      hasReplies: z
        .boolean()
        .optional()
        .describe("Filter by which activities have replies"),
      hasRepliesOrTypeText: z
        .boolean()
        .optional()
        .describe("Filter by which activities have replies or text"),
      createdAt: z
        .number()
        .optional()
        .describe("The time at which the activity was created"),
      id_not: z
        .number()
        .optional()
        .describe("Exclude an activity with the given ID"),
      id_in: z
        .array(z.number())
        .optional()
        .describe("Include any activities with the given IDs"),
      id_not_in: z
        .array(z.number())
        .optional()
        .describe("Excludes any activities with the given IDs"),
      userId_not: z
        .number()
        .optional()
        .describe("Exclude any activity with the given userID"),
      userId_in: z
        .array(z.number())
        .optional()
        .describe("Includes any activity with the given userIDs"),
      userId_not_in: z
        .array(z.number())
        .optional()
        .describe("Exclude any activity with the given userIDs"),
      messengerId_not: z
        .number()
        .optional()
        .describe("Exclude any activity with the given message sender ID"),
      messengerId_in: z
        .array(z.number())
        .optional()
        .describe("Include any activity with the given message sender IDs"),
      messengerId_not_in: z
        .array(z.number())
        .optional()
        .describe("Exclude any activity with the given message sender IDs"),
      mediaId_not: z
        .number()
        .optional()
        .describe("Exclude any activity with the given media ID"),
      mediaId_in: z
        .array(z.number())
        .optional()
        .describe("Include any activity with the given media IDs"),
      mediaId_not_in: z
        .array(z.number())
        .optional()
        .describe("Exclude any activity with the given media IDs"),
      type_not: ActivityTypeSchema.optional().describe(
        "Exclude any activity with the same ActivityType",
      ),
      type_in: z
        .array(ActivityTypeSchema)
        .optional()
        .describe("Include any activity with the given ActivityTypes"),
      type_not_in: z
        .array(ActivityTypeSchema)
        .optional()
        .describe("Exclude any activity with the given ActivityTypes"),
      createdAt_greater: z
        .number()
        .optional()
        .describe("Include any activity created at the given date or more recent"),
      createdAt_lesser: z
        .number()
        .optional()
        .describe("Include any activity created at the given date or less recent"),
      sort: z
        .array(ActivitySortSchema)
        .optional()
        .describe("Sort the query by the parameters given."),
    });
  • tools/search.ts:12-64 (registration)
    Registers the 'search_activity' tool on the MCP server with its name, description, input schema, metadata, and handler function.
    server.tool(
      "search_activity",
      "Search for activities on AniList",
      {
        activityID: z
          .number()
          .optional()
          .describe(
            "The activity ID to lookup (leave it as undefined for no specific ID)",
          ),
        filter: ActivityFilterTypesSchema.optional().describe(
          "Filter object for searching activities (leave it as undefined for no specific filter)",
        ),
        page: z
          .number()
          .optional()
          .default(1)
          .describe("Page number for results"),
        perPage: z
          .number()
          .optional()
          .default(5)
          .describe("Results per page (max 25)"),
      },
      {
        title: "AniList Activity Search",
        readOnlyHint: true,
        openWorldHint: true,
      },
      async ({ activityID, filter, page, perPage }) => {
        try {
          const results = await anilist.searchEntry.activity(
            activityID,
            filter,
            page,
            perPage,
          );
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify(results, null, 2),
              },
            ],
          };
        } catch (error: any) {
          return {
            content: [{ type: "text", text: `Error: ${error.message}` }],
            isError: true,
          };
        }
      },
    );
  • tools/index.ts:37-37 (registration)
    Invokes registerSearchTools to register all search tools including search_activity.
    registerSearchTools(server, anilist);
Behavior2/5

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

With no annotations, the description carries full burden but only states the action without behavioral details. It doesn't disclose if this is a read-only operation, requires authentication, has rate limits, returns paginated results, or affects data. For a search tool with complex parameters, this is a significant gap in transparency.

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 with zero waste. It's front-loaded and appropriately sized for a tool where detailed context is deferred to the schema, making it highly concise and well-structured.

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?

For a search tool with 4 parameters, nested objects, no annotations, and no output schema, the description is incomplete. It lacks behavioral context, usage guidelines, and output details, failing to compensate for the absence of structured metadata, which could hinder effective tool selection.

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?

Schema description coverage is 100%, so parameters are well-documented in the schema. The description adds no additional meaning beyond implying search functionality, which is already clear from the tool name. Baseline score of 3 is appropriate as the schema handles parameter semantics adequately.

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

Purpose3/5

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

The description 'Search for activities on AniList' states the basic purpose (verb+resource) but is vague about what 'activities' entail compared to siblings like 'get_activity' or 'get_user_activity'. It doesn't specify scope (e.g., global vs user-specific) or differentiate from similar tools, leaving ambiguity.

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?

No guidance is provided on when to use this tool versus alternatives like 'get_activity' (which might fetch a single activity) or 'get_user_activity' (user-specific). The description lacks context about prerequisites, exclusions, or recommended scenarios, offering minimal usage direction.

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