Skip to main content
Glama
AmeliaMiddleton

moviefinder-mcp

discover_movies

Discover movies filtered by genre, minimum rating, release year, and sort order to find films that match your preferences.

Instructions

Discover movies by genre, minimum rating, year, and sort order.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
genreNoGenre name (e.g. 'Action', 'Comedy').
min_ratingNoMinimum vote average.
yearNoPrimary release year.
sort_byNoTMDB sort key, e.g. 'popularity.desc', 'vote_average.desc', 'primary_release_date.desc'.

Implementation Reference

  • src/index.ts:109-114 (registration)
    Registration of the 'discover_movies' tool with the MCP server, binding its schema and handler.
    server.tool(
      "discover_movies",
      "Discover movies by genre, minimum rating, year, and sort order.",
      discoverMoviesSchema,
      wrap(discoverMovies),
    );
  • Zod schema defining input parameters for discover_movies: genre (string), min_rating (number 0-10), year (integer 1880-2100), sort_by (string).
    export const discoverMoviesSchema = {
      genre: z.string().optional().describe("Genre name (e.g. 'Action', 'Comedy')."),
      min_rating: z.number().min(0).max(10).optional().describe("Minimum vote average."),
      year: z.number().int().min(1880).max(2100).optional().describe("Primary release year."),
      sort_by: z
        .string()
        .optional()
        .describe(
          "TMDB sort key, e.g. 'popularity.desc', 'vote_average.desc', 'primary_release_date.desc'.",
        ),
    };
  • Core handler function that resolves genre name to ID, calls TMDB /discover/movie endpoint, and returns summarized results.
    export async function discoverMovies(args: {
      genre?: string;
      min_rating?: number;
      year?: number;
      sort_by?: string;
    }) {
      let genreId: number | undefined;
      if (args.genre) {
        const id = await getMovieGenreId(args.genre);
        if (id == null) {
          throw new Error(
            `Unknown genre '${args.genre}'. Try one like Action, Comedy, Drama, Horror, Romance, Science Fiction.`,
          );
        }
        genreId = id;
      }
    
      const data = await tmdbGet<PaginatedResponse<MovieListItem>>("/discover/movie", {
        with_genres: genreId,
        "vote_average.gte": args.min_rating,
        primary_release_year: args.year,
        sort_by: args.sort_by ?? "popularity.desc",
        include_adult: "false",
        language: "en-US",
      });
    
      return {
        page: data.page,
        total_results: data.total_results,
        results: data.results.map(summarizeMovie),
      };
    }
  • Helper function summarizeMovie used in discoverMovies to format movie results (id, title, year, overview, rating, poster).
    function summarizeMovie(m: MovieListItem) {
      return {
        id: m.id,
        title: m.title,
        year: yearOf(m.release_date),
        overview: m.overview ?? null,
        rating: m.vote_average ?? null,
        poster: posterUrl(m.poster_path),
      };
    }
Behavior2/5

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

No annotations are present, and the description does not disclose behavioral traits such as idempotency, authorization needs, or side effects. It only states the action without explaining what happens during invocation.

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

Conciseness4/5

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

The description is a single sentence with no redundant words. It front-loads the action and lists parameters efficiently.

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 lack of output schema and annotations, the description is insufficient. It omits information about pagination, result format, default behavior, or any post-condition. For a discovery tool, more context is needed to fully understand output and constraints.

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 input schema has 100% coverage with descriptions for all parameters. The description adds no extra meaning beyond listing the parameter names, so it meets the baseline expectation.

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 tool's purpose (discovering movies) and lists the filtering criteria (genre, minimum rating, year, sort order). It distinguishes from siblings like 'search_movies' and 'get_trending' by implying a filtered discovery use case, but does not explicitly differentiate.

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 like 'search_movies' or 'get_recommendations'. No context about prerequisites or limitations is given.

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