Skip to main content
Glama
AmeliaMiddleton

moviefinder-mcp

search_movies

Find movies by title and optionally filter by release year to get accurate results from TMDB.

Instructions

Search TMDB for movies by title, optionally filtered by release year.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesMovie title or keywords.
yearNoRelease year filter.

Implementation Reference

  • Main handler function for the search_movies tool. Calls TMDB /search/movie endpoint with query and optional year, then maps results through summarizeMovie.
    export async function searchMovies(args: { query: string; year?: number }) {
      const data = await tmdbGet<PaginatedResponse<MovieListItem>>("/search/movie", {
        query: args.query,
        year: args.year,
        include_adult: "false",
        language: "en-US",
      });
      return {
        page: data.page,
        total_results: data.total_results,
        results: data.results.map(summarizeMovie),
      };
    }
  • Zod schema defining the input parameters: query (required string) and year (optional integer between 1880-2100).
    export const searchMoviesSchema = {
      query: z.string().min(1).describe("Movie title or keywords."),
      year: z.number().int().min(1880).max(2100).optional().describe("Release year filter."),
    };
  • src/index.ts:60-65 (registration)
    Registration of the 'search_movies' tool on the McpServer with its schema and wrapped handler.
    server.tool(
      "search_movies",
      "Search TMDB for movies by title, optionally filtered by release year.",
      searchMoviesSchema,
      wrap(searchMovies),
    );
  • Helper function summarizeMovie used by searchMovies to format each movie result.
    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),
      };
    }
  • The wrap() utility that catches errors and formats the result into a ToolResult.
    function wrap<T>(fn: (args: T) => Promise<unknown>) {
      return async (args: T): Promise<ToolResult> => {
        try {
          return ok(await fn(args));
        } catch (err) {
          return fail(err);
        }
      };
    }
Behavior2/5

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

No annotations are provided, and the description does not disclose behavioral traits such as pagination, rate limits, result limits, or handling of empty results. For a search tool, these are important but missing.

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 sentence with no redundant information. It is front-loaded and concise, earning 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?

The tool has no output schema and no description of return values. Given the lack of annotations and missing behavioral details (e.g., pagination), the description is insufficient for complete understanding.

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 covers both parameters with descriptions (100% coverage). The description repeats 'by title' and 'optionally filtered by release year', adding minimal new meaning beyond the schema.

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 'search', the resource 'movies', and the optional filter by release year. It distinguishes from siblings like 'discover_movies' which implies more complex filtering.

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 explicit guidance on when to use this tool versus alternatives like 'discover_movies' or 'get_trending'. The description only mentions optional filtering but does not provide context for tool selection.

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