get_showtimes
Find available movie showtimes by specifying a movie ID, date, and location to retrieve schedule information for AMC Theatres.
Instructions
Fetches available showtimes for a specific movie and location.
Args: movie_id: Movie ID (e.g., "mv001") date: Date in YYYY-MM-DD format (e.g., "2025-10-28") location: City, state or ZIP code
Returns: JSON string with available showtimes
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| movie_id | Yes | ||
| date | Yes | ||
| location | Yes |
Implementation Reference
- src/amc_mcp/fastmcp_server.py:221-249 (handler)Core handler logic for the get_showtimes tool in FastMCP implementation, filters showtimes by movie_id and date from global mock data.def _get_showtimes(movie_id: str, date: str, location: str) -> str: """Internal implementation of get_showtimes""" if not movie_id or movie_id not in movies: return json.dumps({"error": "Invalid movie ID"}) movie = movies[movie_id] showtime_list = [] for showtime in showtimes.values(): if showtime.movie_id == movie_id and showtime.date == date: theater = theaters.get(showtime.theater_id) if theater: showtime_list.append({ "showtime_id": showtime.showtime_id, "theater_name": theater.name, "theater_address": theater.address, "time": showtime.time, "format": showtime.format, "price": showtime.price }) result = { "movie": {"id": movie.movie_id, "title": movie.title}, "date": date, "location": location, "showtimes": showtime_list } return json.dumps(result, indent=2)
- src/amc_mcp/fastmcp_server.py:253-265 (registration)FastMCP tool decorator registration for get_showtimes, including docstring parameters and delegation to internal handler.def get_showtimes(movie_id: str, date: str, location: str) -> str: """ Fetches available showtimes for a specific movie and location. Args: movie_id: Movie ID (e.g., "mv001") date: Date in YYYY-MM-DD format (e.g., "2025-10-28") location: City, state or ZIP code Returns: JSON string with available showtimes """ return _get_showtimes(movie_id, date, location)
- src/amc_mcp/server.py:147-159 (schema)Input schema and metadata for get_showtimes tool defined in the list_tools handler.Tool( name="get_showtimes", description="Fetches available showtimes for a specific movie and location", inputSchema={ "type": "object", "properties": { "movie_id": {"type": "string", "description": "Movie ID"}, "date": {"type": "string", "description": "Date in YYYY-MM-DD format"}, "location": {"type": "string", "description": "City, state or ZIP code"} }, "required": ["movie_id", "date", "location"] } ),
- src/amc_mcp/server.py:300-336 (handler)Async handler method for executing get_showtimes tool in standard MCP server implementation, similar logic to FastMCP version.async def _get_showtimes(self, args: Dict[str, Any]) -> CallToolResult: """Get showtimes for a movie on a specific date and location""" movie_id = args.get("movie_id") date = args.get("date") location = args.get("location") if not movie_id or movie_id not in self.movies: return CallToolResult( content=[TextContent(type="text", text=json.dumps({"error": "Invalid movie ID"}))] ) movie = self.movies[movie_id] showtimes = [] for showtime in self.showtimes.values(): if showtime.movie_id == movie_id and showtime.date == date: theater = self.theaters.get(showtime.theater_id) if theater: showtimes.append({ "showtime_id": showtime.showtime_id, "theater_name": theater.name, "theater_address": theater.address, "time": showtime.time, "format": showtime.format, "price": showtime.price }) result = { "movie": {"id": movie.movie_id, "title": movie.title}, "date": date, "location": location, "showtimes": showtimes } return CallToolResult( content=[TextContent(type="text", text=json.dumps(result, indent=2))] )
- src/amc_mcp/server.py:208-209 (registration)Dispatch logic in call_tool handler that routes get_showtimes requests to the specific handler method.elif request.name == "get_showtimes": return await self._get_showtimes(request.arguments)