Skip to main content
Glama
sudhish

Indian Movies MCP Agent

by sudhish

get_movie_recommendations

Find Indian movie recommendations by filtering with genre, language, rating, or release year preferences.

Instructions

Get Indian movie recommendations based on genre, language, or rating preferences

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
genreNoPreferred genre (e.g., Comedy, Drama, Action, etc.)
languageNoPreferred language (e.g., Hindi, Telugu, Tamil, etc.)
min_ratingNoMinimum rating (0-10)
year_afterNoMovies released after this year

Implementation Reference

  • Main handler for get_movie_recommendations tool in stdio MCP server. Filters the indianMovies array based on genre, language, min_rating, and year_after parameters, logs each step, and returns a text content response with JSON-stringified filtered movies.
    case 'get_movie_recommendations': {
      log('=== EXECUTING get_movie_recommendations TOOL ===');
      log('Processing movie recommendations request with filters...');
      
      let filteredMovies = [...indianMovies];
      log('Starting with total movies:', { count: filteredMovies.length });
    
      // Filter by genre
      if (args.genre) {
        log('=== APPLYING GENRE FILTER ===');
        log('Requested genre:', args.genre);
        const beforeCount = filteredMovies.length;
        filteredMovies = filteredMovies.filter(movie =>
          movie.genre.some(g => g.toLowerCase().includes(args.genre.toLowerCase()))
        );
        log('Genre filter results:', { 
          before: beforeCount, 
          after: filteredMovies.length,
          filtered_out: beforeCount - filteredMovies.length
        });
        log('Remaining movies after genre filter:', filteredMovies.map(m => m.title));
      }
    
      // Filter by language
      if (args.language) {
        log('=== APPLYING LANGUAGE FILTER ===');
        log('Requested language:', args.language);
        const beforeCount = filteredMovies.length;
        filteredMovies = filteredMovies.filter(movie =>
          movie.language.toLowerCase() === args.language.toLowerCase()
        );
        log('Language filter results:', { 
          before: beforeCount, 
          after: filteredMovies.length,
          filtered_out: beforeCount - filteredMovies.length
        });
        log('Remaining movies after language filter:', filteredMovies.map(m => m.title));
      }
    
      // Filter by minimum rating
      if (args.min_rating) {
        log('=== APPLYING RATING FILTER ===');
        log('Minimum rating requested:', args.min_rating);
        const beforeCount = filteredMovies.length;
        filteredMovies = filteredMovies.filter(movie =>
          movie.rating >= args.min_rating
        );
        log('Rating filter results:', { 
          before: beforeCount, 
          after: filteredMovies.length,
          filtered_out: beforeCount - filteredMovies.length
        });
        log('Remaining movies after rating filter:', filteredMovies.map(m => `${m.title} (${m.rating})`));
      }
    
      // Filter by year
      if (args.year_after) {
        log('=== APPLYING YEAR FILTER ===');
        log('Movies after year:', args.year_after);
        const beforeCount = filteredMovies.length;
        filteredMovies = filteredMovies.filter(movie =>
          movie.year > args.year_after
        );
        log('Year filter results:', { 
          before: beforeCount, 
          after: filteredMovies.length,
          filtered_out: beforeCount - filteredMovies.length
        });
        log('Remaining movies after year filter:', filteredMovies.map(m => `${m.title} (${m.year})`));
      }
    
      log('=== FINAL FILTERING RESULTS ===');
      log('Total movies found:', filteredMovies.length);
      log('Final movie list:', filteredMovies.map(m => `${m.title} (${m.year}) - ${m.language}`));
    
      const response = {
        content: [
          {
            type: 'text',
            text: JSON.stringify(filteredMovies, null, 2),
          },
        ],
      };
      
      log('=== SENDING get_movie_recommendations RESPONSE ===');
      log('Response structure:', {
        content_type: 'text',
        movie_count: filteredMovies.length,
        response_size_chars: JSON.stringify(filteredMovies).length
      });
      log('Full response object:', JSON.stringify(response, null, 2));
      
      return response;
    }
  • Input schema definition for the get_movie_recommendations tool provided in the ListToolsRequestSchema handler.
      name: 'get_movie_recommendations',
      description: 'Get Indian movie recommendations based on genre, language, or rating preferences',
      inputSchema: {
        type: 'object',
        properties: {
          genre: {
            type: 'string',
            description: 'Preferred genre (e.g., Comedy, Drama, Action, etc.)',
          },
          language: {
            type: 'string', 
            description: 'Preferred language (e.g., Hindi, Telugu, Tamil, etc.)',
          },
          min_rating: {
            type: 'number',
            description: 'Minimum rating (0-10)',
            minimum: 0,
            maximum: 10,
          },
          year_after: {
            type: 'number',
            description: 'Movies released after this year',
          },
        },
      },
    },
  • Handler for get_movie_recommendations tool in HTTP MCP server. Similar filtering logic without logging, returns text content with JSON-stringified filtered movies.
    case 'get_movie_recommendations': {
      let filteredMovies = [...indianMovies];
    
      if (args.genre) {
        filteredMovies = filteredMovies.filter(movie =>
          movie.genre.some(g => g.toLowerCase().includes(args.genre.toLowerCase()))
        );
      }
    
      if (args.language) {
        filteredMovies = filteredMovies.filter(movie =>
          movie.language.toLowerCase() === args.language.toLowerCase()
        );
      }
    
      if (args.min_rating) {
        filteredMovies = filteredMovies.filter(movie => movie.rating >= args.min_rating);
      }
    
      if (args.year_after) {
        filteredMovies = filteredMovies.filter(movie => movie.year > args.year_after);
      }
    
      return {
        content: [{ type: 'text', text: JSON.stringify(filteredMovies, null, 2) }],
      };
  • Input schema definition for the get_movie_recommendations tool in the HTTP server's ListToolsRequestSchema handler.
    name: 'get_movie_recommendations',
    description: 'Get Indian movie recommendations based on genre, language, or rating preferences',
    inputSchema: {
      type: 'object',
      properties: {
        genre: { type: 'string', description: 'Preferred genre' },
        language: { type: 'string', description: 'Preferred language' },
        min_rating: { type: 'number', description: 'Minimum rating (0-10)', minimum: 0, maximum: 10 },
        year_after: { type: 'number', description: 'Movies released after this year' },
      },
    },
  • The indianMovies database array used by the get_movie_recommendations handler for filtering and recommendations.
    const indianMovies = [
      {
        title: "3 Idiots",
        year: 2009,
        genre: ["Comedy", "Drama"],
        language: "Hindi",
        rating: 8.4,
        director: "Rajkumar Hirani",
        description: "Two friends search for their long lost companion while reflecting on their college days."
      },
      {
        title: "Dangal",
        year: 2016,
        genre: ["Biography", "Drama", "Sport"],
        language: "Hindi",
        rating: 8.4,
        director: "Nitesh Tiwari",
        description: "Former wrestler Mahavir Singh trains his daughters to become world-class wrestlers."
      },
      {
        title: "Baahubali 2",
        year: 2017,
        genre: ["Action", "Drama"],
        language: "Telugu",
        rating: 8.2,
        director: "S.S. Rajamouli",
        description: "Shiva discovers his legacy and must save his love and his kingdom."
      },
      {
        title: "Taare Zameen Par",
        year: 2007,
        genre: ["Drama", "Family"],
        language: "Hindi",
        rating: 8.4,
        director: "Aamir Khan",
        description: "An eight-year-old boy is thought to be lazy but actually has dyslexia."
      },
      {
        title: "Zindagi Na Milegi Dobara",
        year: 2011,
        genre: ["Adventure", "Comedy", "Drama"],
        language: "Hindi",
        rating: 8.2,
        director: "Zoya Akhtar",
        description: "Three friends on a bachelor trip discover themselves and their friendship."
      },
      {
        title: "Lagaan",
        year: 2001,
        genre: ["Adventure", "Drama", "Musical"],
        language: "Hindi",
        rating: 8.1,
        director: "Ashutosh Gowariker",
        description: "Villagers accept a challenge from British officers to play cricket to avoid taxes."
      },
      {
        title: "Queen",
        year: 2013,
        genre: ["Comedy", "Drama"],
        language: "Hindi",
        rating: 8.2,
        director: "Vikas Bahl",
        description: "A woman goes on her honeymoon alone and discovers herself."
      },
      {
        title: "Tumhari Sulu",
        year: 2017,
        genre: ["Comedy", "Drama"],
        language: "Hindi",
        rating: 7.1,
        director: "Suresh Triveni",
        description: "A housewife becomes a radio jockey and finds her voice."
      },
      {
        title: "Andhadhun",
        year: 2018,
        genre: ["Crime", "Thriller"],
        language: "Hindi",
        rating: 8.2,
        director: "Sriram Raghavan",
        description: "A blind pianist gets embroiled in multiple murders."
      },
      {
        title: "Kumbakonam Gopals",
        year: 2015,
        genre: ["Comedy"],
        language: "Tamil",
        rating: 7.8,
        director: "PC Shekar",
        description: "A hilarious tale of a small-town family."
      }
    ];
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool's purpose but doesn't describe how it works—whether it returns a fixed number of results, uses collaborative filtering, requires authentication, has rate limits, or what the output format looks like. The description is functional but lacks operational details needed for an agent to understand the tool's behavior beyond basic input parameters.

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 that directly states the tool's purpose without unnecessary words. It's front-loaded with the core action and resource, making it easy to parse. Every part of the sentence contributes to understanding the tool's function.

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 tool with 4 parameters, 100% schema coverage, and no output schema, the description is adequate but incomplete. It covers the basic purpose and filtering scope but lacks details on output (e.g., what data is returned, format, pagination) and behavioral context (e.g., how recommendations are generated, limitations). Given the absence of annotations and output schema, the description should provide more operational context to be fully helpful.

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 description mentions filtering by 'genre, language, or rating preferences,' which aligns with three of the four parameters in the schema (genre, language, min_rating). It doesn't mention 'year_after,' but since schema description coverage is 100% (all parameters are well-documented in the schema), the baseline score of 3 is appropriate. The description adds minimal value beyond what the schema already provides.

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 resource ('Indian movie recommendations') with specific filtering criteria ('based on genre, language, or rating preferences'). It distinguishes from 'get_random_movie' by specifying filtered recommendations rather than random selection, though it doesn't explicitly differentiate from 'search_movie' which might offer broader search capabilities.

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 its siblings ('get_random_movie' or 'search_movie'). It mentions filtering criteria but doesn't specify whether this is for personalized recommendations, curated lists, or how it differs from the search functionality. No exclusions or alternative scenarios are 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/sudhish/indian-movies-mcp'

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