Skip to main content
Glama
sudhish

Indian Movies MCP Agent

by sudhish

get_random_movie

Discover a random Indian movie recommendation from Bollywood and regional cinema to help you find something new to watch.

Instructions

Get a random Indian movie recommendation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Main handler implementation for the 'get_random_movie' tool in the stdio MCP server. Selects a random index from the indianMovies array, retrieves the movie, logs extensively, and returns the movie details as a JSON string in the tool response content.
    case 'get_random_movie': { log('=== EXECUTING get_random_movie TOOL ==='); log('Processing random movie request...'); log('Total movies available for random selection:', indianMovies.length); log('=== GENERATING RANDOM SELECTION ==='); const randomIndex = Math.floor(Math.random() * indianMovies.length); log('Generated random index:', randomIndex); log('Index range: 0 to', indianMovies.length - 1); const randomMovie = indianMovies[randomIndex]; log('=== RANDOM MOVIE SELECTED ==='); log('Selected movie:', randomMovie.title); log('Movie index:', randomIndex); log('Movie details:', JSON.stringify(randomMovie, null, 2)); const response = { content: [ { type: 'text', text: JSON.stringify(randomMovie, null, 2), }, ], }; log('=== SENDING get_random_movie RESPONSE ==='); log('Response contains movie:', randomMovie.title); log('Full random movie response:', JSON.stringify(response, null, 2)); return response; }
  • Concise handler implementation for the 'get_random_movie' tool in the HTTP/SSE MCP server. Directly selects and returns a random movie from indianMovies as JSON.
    case 'get_random_movie': { const randomMovie = indianMovies[Math.floor(Math.random() * indianMovies.length)]; return { content: [{ type: 'text', text: JSON.stringify(randomMovie, null, 2) }], }; }
  • Tool schema definition for 'get_random_movie' in the list tools response, indicating no input parameters required.
    { name: 'get_random_movie', description: 'Get a random Indian movie recommendation', inputSchema: { type: 'object', properties: {}, }, },
  • Tool schema definition for 'get_random_movie' in the HTTP server's list tools response, no input parameters.
    name: 'get_random_movie', description: 'Get a random Indian movie recommendation', inputSchema: { type: 'object', properties: {} },
  • The indianMovies array containing the database of Indian movies from which the random movie is selected by the handlers.
    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." } ];

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