Skip to main content
Glama

get_anime

Retrieve detailed anime information using the AniList ID through the AniList MCP server. Simplify accessing accurate data for any anime.

Instructions

Get detailed information about an anime by its AniList ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe AniList ID of the anime

Implementation Reference

  • The core handler function for the 'get_anime' tool. It takes one or more AniList anime IDs, fetches the media details using the AniList client, optionally filters the response to essential fields, formats as JSON, and returns as text content. Handles single ID or array, and errors gracefully.
      async ({ ids, fullData }) => {
        try {
          const idArray = Array.isArray(ids) ? ids : [ids];
          const results = await Promise.all(
            idArray.map((id) => anilist.media.anime(id)),
          );
    
          // Filter results unless fullData is explicitly requested
          const filteredResults = fullData ? results : filterMedia(results);
    
          // Return single object if single ID was provided, array if multiple
          const res = Array.isArray(ids)
            ? filteredResults
            : (filteredResults as FilteredMediaEntry[])[0];
    
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify(res, null, 2),
              },
            ],
          };
        } catch (error: any) {
          return {
            content: [{ type: "text", text: `Error: ${error.message}` }],
            isError: true,
          };
        }
      },
    );
  • Input schema for the 'get_anime' tool defined using Zod. Supports single anime ID (number) or array of IDs, and optional boolean fullData flag to bypass filtering.
    {
      ids: z
        .union([z.number(), z.array(z.number())])
        .describe("The AniList ID or array of IDs of the anime"),
      fullData: z
        .boolean()
        .optional()
        .default(false)
        .describe(
          "Set to true to get full unfiltered data (may be very large). Default is false to return only essential fields.",
        ),
    },
  • tools/media.ts:15-64 (registration)
    Direct registration of the 'get_anime' tool on the MCP server within registerMediaTools. Includes tool name, description, input schema, metadata hints (read-only, open-world), and inline handler function.
      "get_anime",
      "Get detailed information about anime by AniList ID(s)",
      {
        ids: z
          .union([z.number(), z.array(z.number())])
          .describe("The AniList ID or array of IDs of the anime"),
        fullData: z
          .boolean()
          .optional()
          .default(false)
          .describe(
            "Set to true to get full unfiltered data (may be very large). Default is false to return only essential fields.",
          ),
      },
      {
        title: "Get Anime Details",
        readOnlyHint: true,
        openWorldHint: true,
      },
      async ({ ids, fullData }) => {
        try {
          const idArray = Array.isArray(ids) ? ids : [ids];
          const results = await Promise.all(
            idArray.map((id) => anilist.media.anime(id)),
          );
    
          // Filter results unless fullData is explicitly requested
          const filteredResults = fullData ? results : filterMedia(results);
    
          // Return single object if single ID was provided, array if multiple
          const res = Array.isArray(ids)
            ? filteredResults
            : (filteredResults as FilteredMediaEntry[])[0];
    
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify(res, null, 2),
              },
            ],
          };
        } catch (error: any) {
          return {
            content: [{ type: "text", text: `Error: ${error.message}` }],
            isError: true,
          };
        }
      },
    );
  • tools/index.ts:34-34 (registration)
    Invocation of registerMediaTools in the central registerAllTools function, which registers the 'get_anime' tool among other media tools.
    registerMediaTools(server, anilist, config);
  • Helper function used in the 'get_anime' handler to filter large AniList media responses down to essential fields, reducing payload size. Supports single entry or array.
    export function filterMedia(
      media: AnimeEntry | MangaEntry | AnimeEntry[] | MangaEntry[],
    ): FilteredMediaEntry | FilteredMediaEntry[] {
      if (Array.isArray(media)) {
        return media.map((m) => filterSingleMedia(m));
      }
    
      return filterSingleMedia(media);
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states it's a read operation ('Get'), but doesn't disclose behavioral traits like rate limits, authentication needs, error handling, or response format. For a tool with no annotation coverage, this leaves significant gaps in understanding its behavior.

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 with the core purpose and includes the key constraint (by AniList ID). Every word earns its place.

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 no annotations and no output schema, the description is incomplete. It doesn't explain what 'detailed information' includes, error cases, or response structure. For a tool with rich sibling context (e.g., media retrieval), more detail is needed to guide effective 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?

Schema description coverage is 100%, with the parameter 'id' fully documented in the schema. The description adds minimal value by specifying 'AniList ID', which is already in the schema description. Baseline 3 is appropriate as the schema does the heavy lifting.

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 clearly states the verb 'Get' and the resource 'detailed information about an anime', specifying it's by AniList ID. It distinguishes from siblings like search_anime by focusing on retrieval by ID rather than search queries, though it doesn't explicitly mention this distinction.

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 search_anime or get_user_anime_list. The description implies usage when you have an AniList ID, but offers no context on prerequisites, limitations, or sibling tool comparisons.

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