get_now_showing
Find movies currently playing in your area by entering your city or ZIP code to see available showtimes and film listings.
Instructions
Returns a list of movies currently showing in a given city or ZIP code.
Args: location: City, state or ZIP code (e.g., "Boston, MA")
Returns: JSON string with list of movies
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| location | Yes |
Implementation Reference
- src/amc_mcp/server.py:226-251 (handler)Main handler for 'get_now_showing' tool in standard MCP server implementation. Retrieves and formats mock movie data for the specified location.async def _get_now_showing(self, args: Dict[str, Any]) -> CallToolResult: """Get movies currently showing in a location""" location = args.get("location", "") # Filter movies by location (simplified - match any theater in the area) showing_movies = [] for movie in self.movies.values(): # Simple mock logic - show all movies for any location movie_data = { "movie_id": movie.movie_id, "title": movie.title, "rating": movie.rating, "duration": movie.duration, "genre": movie.genre, "description": movie.description } showing_movies.append(movie_data) result = { "location": location, "movies": showing_movies[:10] # Limit to 10 movies } return CallToolResult( content=[TextContent(type="text", text=json.dumps(result, indent=2))] )
- src/amc_mcp/server.py:124-134 (registration)Registration of the 'get_now_showing' tool including name, description, and input schema in the list_tools handler.Tool( name="get_now_showing", description="Returns a list of movies currently showing in a given city or ZIP code", inputSchema={ "type": "object", "properties": { "location": {"type": "string", "description": "City, state or ZIP code"} }, "required": ["location"] } ),
- src/amc_mcp/fastmcp_server.py:136-147 (handler)Handler and registration for 'get_now_showing' tool in FastMCP implementation, delegates to helper function.@mcp.tool() def get_now_showing(location: str) -> str: """ Returns a list of movies currently showing in a given city or ZIP code. Args: location: City, state or ZIP code (e.g., "Boston, MA") Returns: JSON string with list of movies """ return _get_now_showing(location)
- Helper function containing the core logic for fetching currently showing movies using global mock data.def _get_now_showing(location: str) -> str: """ Returns a list of movies currently showing in a given city or ZIP code. Args: location: City, state or ZIP code (e.g., "Boston, MA") Returns: JSON string with list of movies """ showing_movies = [] for movie in movies.values(): movie_data = { "movie_id": movie.movie_id, "title": movie.title, "rating": movie.rating, "duration": movie.duration, "genre": movie.genre, "description": movie.description } showing_movies.append(movie_data) result = { "location": location, "movies": showing_movies[:10] } return json.dumps(result, indent=2)