get_now_showing
Find movies currently playing in theaters near you by entering your city or ZIP code. Get a list of showtimes and available films for AMC Theatres.
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:124-134 (registration)Registers the get_now_showing tool with name, description, and input schema requiring 'location' parameter.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/server.py:226-251 (handler)Core handler function for the get_now_showing tool. Extracts location from arguments, loads mock movie data, and returns JSON-formatted list of up to 10 movies currently showing.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/fastmcp_server.py:137-147 (handler)FastMCP implementation of the get_now_showing tool handler, decorated for automatic registration, delegates to internal helper.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 shared logic for retrieving and formatting movies currently showing for a location (identical to server.py implementation).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)
- src/amc_mcp/fastmcp_server.py:137-147 (registration)FastMCP registration of the get_now_showing tool via @mcp.tool() decorator on the handler function.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)