Skip to main content
Glama
gavxm
by gavxm

anilist_reviews

Read-onlyIdempotent

Retrieve community reviews for anime or manga, including sentiment summaries, scores, and helpfulness ratios. Understand what others think about a title.

Instructions

Get community reviews for an anime or manga. Use when the user wants to see what others think about a title. Returns sentiment summary (positive/mixed/negative), individual review scores, summaries, and helpful ratios.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idNoAniList media ID
titleNoSearch by title if no ID is known
typeNoMedia type. Defaults to ANIME.ANIME
sortNoSort by most helpful or newestHELPFUL
limitNoNumber of reviews to return (default 5, max 10)
pageNoPage number for pagination (default 1)

Implementation Reference

  • The execute handler for the 'anilist_reviews' tool. It queries the AniList API for reviews of a media title, computes a sentiment summary (positive/mixed/negative) based on average score, formats individual review details (score, summary, body excerpt, helpfulness ratio), and returns the result with pagination footer.
    execute: async (args) => {
      try {
        const variables: Record<string, unknown> = {
          type: args.type,
          page: args.page,
          perPage: args.limit,
          sort: REVIEW_SORT_MAP[args.sort],
        };
        if (args.id) variables.id = args.id;
        if (args.title) variables.search = args.title;
    
        const data = await anilistClient.query<MediaReviewsResponse>(
          MEDIA_REVIEWS_QUERY,
          variables,
          { cache: "media" },
        );
    
        const media = data.Media;
        const title = getTitle(media.title);
        const { nodes, pageInfo } = media.reviews;
    
        if (!nodes.length) {
          return `No reviews found for ${title}.`;
        }
    
        // Sentiment summary
        const avgScore = Math.round(
          nodes.reduce((sum, r) => sum + r.score, 0) / nodes.length,
        );
        const sentiment =
          avgScore >= 75
            ? "Generally positive"
            : avgScore >= 50
              ? "Mixed"
              : "Generally negative";
        const header = `Reviews for ${title} - ${sentiment} (avg ${avgScore}/100 across ${pageInfo.total} reviews)`;
    
        const formatted = nodes.map((r, i) => {
          const date = new Date(r.createdAt * 1000).toLocaleDateString(
            "en-US",
            { month: "short", day: "numeric", year: "numeric" },
          );
          const helpful =
            r.ratingAmount > 0
              ? `${r.rating}/${r.ratingAmount} found helpful`
              : "No votes";
          const body = truncateDescription(r.body, 300);
    
          return [
            `${i + 1}. ${r.score}/100 by ${r.user.name} (${date})`,
            `   ${r.summary}`,
            `   ${body}`,
            `   ${helpful}`,
          ].join("\n");
        });
    
        const footer = paginationFooter(
          args.page,
          args.limit,
          pageInfo.total,
          pageInfo.hasNextPage,
        );
    
        return (
          [header, "", ...formatted].join("\n\n") +
          (footer ? `\n\n${footer}` : "")
        );
      } catch (error) {
        return throwToolError(error, "fetching reviews");
      }
    },
  • ReviewsInputSchema defines the input parameters for the anilist_reviews tool: id (optional), title (optional), type (ANIME/MANGA, default ANIME), sort (HELPFUL/NEWEST, default HELPFUL), limit (1-10, default 5), and page. It requires either id or title.
    export const ReviewsInputSchema = z
      .object({
        id: z.number().int().positive().optional().describe("AniList media ID"),
        title: z.string().optional().describe("Search by title if no ID is known"),
        type: z
          .enum(["ANIME", "MANGA"])
          .default("ANIME")
          .describe("Media type. Defaults to ANIME."),
        sort: z
          .enum(["HELPFUL", "NEWEST"])
          .default("HELPFUL")
          .describe("Sort by most helpful or newest"),
        limit: z
          .number()
          .int()
          .min(1)
          .max(10)
          .default(5)
          .describe("Number of reviews to return (default 5, max 10)"),
        page: pageParam,
      })
      .refine((data) => data.id !== undefined || data.title !== undefined, {
        message: "Provide either an id or a title.",
      });
  • The registration of the 'anilist_reviews' tool via server.addTool, including its name, description, parameters (ReviewsInputSchema), annotations, and the execute handler.
    server.addTool({
      name: "anilist_reviews",
      description:
        "Get community reviews for an anime or manga. " +
        "Use when the user wants to see what others think about a title. " +
        "Returns sentiment summary (positive/mixed/negative), individual review scores, summaries, and helpful ratios.",
      parameters: ReviewsInputSchema,
      annotations: {
        title: "Community Reviews",
        readOnlyHint: true,
        destructiveHint: false,
        idempotentHint: true,
        openWorldHint: true,
      },
      execute: async (args) => {
        try {
          const variables: Record<string, unknown> = {
            type: args.type,
            page: args.page,
            perPage: args.limit,
            sort: REVIEW_SORT_MAP[args.sort],
          };
          if (args.id) variables.id = args.id;
          if (args.title) variables.search = args.title;
    
          const data = await anilistClient.query<MediaReviewsResponse>(
            MEDIA_REVIEWS_QUERY,
            variables,
            { cache: "media" },
          );
    
          const media = data.Media;
          const title = getTitle(media.title);
          const { nodes, pageInfo } = media.reviews;
    
          if (!nodes.length) {
            return `No reviews found for ${title}.`;
          }
    
          // Sentiment summary
          const avgScore = Math.round(
            nodes.reduce((sum, r) => sum + r.score, 0) / nodes.length,
          );
          const sentiment =
            avgScore >= 75
              ? "Generally positive"
              : avgScore >= 50
                ? "Mixed"
                : "Generally negative";
          const header = `Reviews for ${title} - ${sentiment} (avg ${avgScore}/100 across ${pageInfo.total} reviews)`;
    
          const formatted = nodes.map((r, i) => {
            const date = new Date(r.createdAt * 1000).toLocaleDateString(
              "en-US",
              { month: "short", day: "numeric", year: "numeric" },
            );
            const helpful =
              r.ratingAmount > 0
                ? `${r.rating}/${r.ratingAmount} found helpful`
                : "No votes";
            const body = truncateDescription(r.body, 300);
    
            return [
              `${i + 1}. ${r.score}/100 by ${r.user.name} (${date})`,
              `   ${r.summary}`,
              `   ${body}`,
              `   ${helpful}`,
            ].join("\n");
          });
    
          const footer = paginationFooter(
            args.page,
            args.limit,
            pageInfo.total,
            pageInfo.hasNextPage,
          );
    
          return (
            [header, "", ...formatted].join("\n\n") +
            (footer ? `\n\n${footer}` : "")
          );
        } catch (error) {
          return throwToolError(error, "fetching reviews");
        }
      },
    });
  • MEDIA_REVIEWS_QUERY is the GraphQL query used to fetch reviews from the AniList API. It queries Media by id/search/type and returns review nodes with id, score, summary, body, rating, ratingAmount, createdAt, and user info.
    export const MEDIA_REVIEWS_QUERY = `
      query MediaReviews($id: Int, $search: String, $type: MediaType, $page: Int, $perPage: Int, $sort: [ReviewSort]) {
        Media(id: $id, search: $search, type: $type) {
          id
          title { romaji english native }
          reviews(page: $page, perPage: $perPage, sort: $sort) {
            pageInfo { total hasNextPage }
            nodes {
              id
              score
              summary
              body
              rating
              ratingAmount
              createdAt
              user { name siteUrl }
            }
          }
        }
      }
    `;
  • MediaReviewsResponse TypeScript interface defines the response shape from the AniList API for the MEDIA_REVIEWS_QUERY, used by the execute handler to type the API response.
    export interface MediaReviewsResponse {
      Media: {
        id: number;
        title: {
          romaji: string | null;
          english: string | null;
          native: string | null;
        };
        reviews: {
          pageInfo: { total: number; hasNextPage: boolean };
          nodes: Array<{
            id: number;
            score: number;
            summary: string;
            body: string;
            rating: number;
            ratingAmount: number;
            createdAt: number;
            user: { name: string; siteUrl: string };
          }>;
        };
      };
Behavior4/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, idempotentHint=true, openWorldHint=true. Description adds that it returns sentiment summary, scores, summaries, and helpful ratios, providing useful behavioral context beyond annotations.

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?

Three sentences, front-loaded with purpose, no fluff. Every sentence adds value.

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

Completeness4/5

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

For a read-only review retrieval tool with thorough schema and annotations, the description covers purpose, usage, and return format. Could mention pagination briefly, but schema covers that. Overall complete.

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 coverage is 100% with detailed parameter descriptions. The description does not add significant parameter-level information beyond that, so baseline 3 is appropriate.

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

Purpose5/5

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

The description clearly states the verb 'Get', resource 'community reviews', and scope 'for an anime or manga'. It distinguishes from siblings like 'anilist_details' and 'anilist_recommendations'.

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

Usage Guidelines4/5

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

Explicitly says 'Use when the user wants to see what others think about a title'. Provides clear context, though no explicit exclusions or alternatives mentioned.

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

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/gavxm/ani-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server