search_movie
Find Indian movies by title using this search tool. Enter a movie name to get specific film information from Bollywood and regional cinema databases.
Instructions
Search for a specific Indian movie by title
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | Yes | Movie title to search for |
Implementation Reference
- index.js:319-367 (handler)The main execution logic for the 'search_movie' tool in the stdio MCP server. Searches the indianMovies array for a movie title containing the input 'title' (case-insensitive substring match), logs extensively, and returns movie details as JSON or 'not found' message in MCP content format.case 'search_movie': { log('=== EXECUTING search_movie TOOL ==='); log('Processing movie search request...'); log('Search term received:', args.title); log('Search term type:', typeof args.title); log('Search term length:', args.title ? args.title.length : 0); log('=== PERFORMING MOVIE SEARCH ==='); log('Available movies to search through:', indianMovies.map(m => m.title)); log('Converting search term to lowercase:', args.title.toLowerCase()); const movie = indianMovies.find(m => { const titleMatch = m.title.toLowerCase().includes(args.title.toLowerCase()); log(`Checking "${m.title}" against "${args.title}": ${titleMatch}`); return titleMatch; }); let response; if (movie) { log('=== MOVIE FOUND ==='); log('Found movie:', movie.title); log('Movie details:', JSON.stringify(movie, null, 2)); response = { content: [ { type: 'text', text: JSON.stringify(movie, null, 2), }, ], }; } else { log('=== MOVIE NOT FOUND ==='); log('No movie found for search term:', args.title); log('Tried searching in:', indianMovies.length, 'movies'); response = { content: [ { type: 'text', text: `No movie found with title containing "${args.title}"`, }, ], }; } log('=== SENDING search_movie RESPONSE ==='); log('Response type:', movie ? 'Movie details' : 'Not found message'); log('Full search response:', JSON.stringify(response, null, 2)); return response; }
- index.js:172-185 (registration)Registration of the 'search_movie' tool in the ListTools response for the stdio server, defining its name, description, and input schema requiring a 'title' string.{ name: 'search_movie', description: 'Search for a specific Indian movie by title', inputSchema: { type: 'object', properties: { title: { type: 'string', description: 'Movie title to search for', }, }, required: ['title'], }, },
- http-server.js:111-123 (handler)Compact execution logic for the 'search_movie' tool in the HTTP MCP server. Performs case-insensitive substring search on movie titles and returns matching movie JSON or 'not found' message.case 'search_movie': { const movie = indianMovies.find(m => m.title.toLowerCase().includes(args.title.toLowerCase()) ); return { content: [ { type: 'text', text: movie ? JSON.stringify(movie, null, 2) : `No movie found with title containing "${args.title}"`, }, ], };
- http-server.js:58-67 (registration)Registration of the 'search_movie' tool in the ListTools response for the HTTP server, defining name, description, and input schema.{ name: 'search_movie', description: 'Search for a specific Indian movie by title', inputSchema: { type: 'object', properties: { title: { type: 'string', description: 'Movie title to search for' }, }, required: ['title'], },