Skip to main content
Glama
AmeliaMiddleton

moviefinder-mcp

get_movie_details

Retrieve complete movie details including cast, director, and trailer URL using a TMDB movie ID.

Instructions

Fetch full details for a movie including cast, director, and trailer URL.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
movie_idYesTMDB movie ID.

Implementation Reference

  • The main handler function for the 'get_movie_details' tool. It fetches movie details from TMDB API (including credits and videos), extracts directors, top-10 cast (sorted by order), trailer URL, and returns a structured response.
    export async function getMovieDetails(args: { movie_id: number }) {
      const data = await tmdbGet<MovieDetails>(`/movie/${args.movie_id}`, {
        append_to_response: "credits,videos",
        language: "en-US",
      });
    
      const directors =
        data.credits?.crew?.filter((c) => c.job === "Director").map((c) => c.name) ?? [];
      const cast =
        data.credits?.cast
          ?.slice()
          .sort((a, b) => (a.order ?? 999) - (b.order ?? 999))
          .slice(0, 10)
          .map((c) => ({ name: c.name, character: c.character ?? null })) ?? [];
    
      const trailer = data.videos?.results?.find(
        (v) => v.site === "YouTube" && v.type === "Trailer" && v.official !== false,
      );
    
      return {
        id: data.id,
        title: data.title,
        year: yearOf(data.release_date),
        tagline: data.tagline ?? null,
        overview: data.overview ?? null,
        rating: data.vote_average ?? null,
        vote_count: data.vote_count ?? null,
        runtime_minutes: data.runtime ?? null,
        genres: data.genres?.map((g) => g.name) ?? [],
        directors,
        cast,
        poster: posterUrl(data.poster_path),
        homepage: data.homepage ?? null,
        imdb_id: data.imdb_id ?? null,
        trailer_url: trailer ? `https://www.youtube.com/watch?v=${trailer.key}` : null,
      };
    }
  • Input schema for the 'get_movie_details' tool. Defines a single required parameter 'movie_id' as a positive integer.
    export const getMovieDetailsSchema = {
      movie_id: z.number().int().positive().describe("TMDB movie ID."),
    };
  • TypeScript interface 'MovieDetails' describing the raw TMDB API response shape including credits (cast/crew) and videos.
    interface MovieDetails {
      id: number;
      title: string;
      release_date?: string | null;
      overview?: string | null;
      vote_average?: number | null;
      vote_count?: number | null;
      runtime?: number | null;
      poster_path?: string | null;
      genres?: Array<{ id: number; name: string }>;
      tagline?: string | null;
      homepage?: string | null;
      imdb_id?: string | null;
      credits?: {
        cast?: Array<{ id: number; name: string; character?: string; order?: number }>;
        crew?: Array<{ id: number; name: string; job?: string; department?: string }>;
      };
      videos?: {
        results?: Array<{
          key: string;
          site: string;
          type: string;
          name: string;
          official?: boolean;
        }>;
      };
    }
  • src/index.ts:74-79 (registration)
    Registration of the 'get_movie_details' tool with the MCP server, binding the schema and wrapped handler.
    server.tool(
      "get_movie_details",
      "Fetch full details for a movie including cast, director, and trailer URL.",
      getMovieDetailsSchema,
      wrap(getMovieDetails),
    );
  • Helper function 'posterUrl' used by the handler to construct full poster image URLs.
    export function posterUrl(path: string | null | undefined): string | null {
      return path ? `${IMAGE_BASE}${path}` : null;
    }
Behavior2/5

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

No annotations are provided, so the description must cover behavioral traits. It only states what fetches; it does not disclose error behavior, authentication needs, rate limits, or the full return structure.

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, clear, and front-loaded sentence with no unnecessary words. Every part contributes to understanding the tool's purpose.

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

Completeness3/5

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

For a simple tool with one parameter and no output schema, the description is adequate but lacks details on return format, error handling, or links to documentation. It covers the basic purpose but not the full context.

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

Parameters4/5

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

The input schema already documents the parameter 'movie_id' with a description (100% coverage). The tool description adds value by explaining what details (cast, director, trailer) will be retrieved, giving context for the parameter's usage.

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 explicitly states the verb 'Fetch', the resource 'full details for a movie', and specific attributes (cast, director, trailer URL). This clearly distinguishes it from sibling tools like search_movies or get_trending.

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

Usage Guidelines3/5

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

The description implies usage when you need detailed info for a specific movie, but it does not mention when not to use it (e.g., for lists, use discover_movies) or provide explicit alternatives.

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/AmeliaMiddleton/Mcp1testtypescript'

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