Skip to main content
Glama

get_seat_map

View available and reserved seating arrangements for AMC movie showtimes to help select seats for booking.

Instructions

Displays available and reserved seats for a specific showtime.

Args: showtime_id: Showtime ID (e.g., "st001")

Returns: JSON string with seat availability map

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
showtime_idYes

Implementation Reference

  • Primary handler implementation for the get_seat_map tool. Retrieves seat availability for a showtime, checks against existing bookings, builds seat map, and returns formatted JSON response.
    async def _get_seat_map(self, args: Dict[str, Any]) -> CallToolResult: """Get seat map for a showtime""" showtime_id = args.get("showtime_id") if not showtime_id or showtime_id not in self.showtimes: return CallToolResult( content=[TextContent(type="text", text=json.dumps({"error": "Invalid showtime ID"}))] ) # Get seats for this showtime (mock data) seats = self.seats_data.get(showtime_id, []) seat_map = [] for seat_data in seats: # Check if seat is already booked is_booked = any( seat_data["seat_number"] in booking.seats and booking.status == "confirmed" for booking in self.bookings.values() if booking.showtime_id == showtime_id ) seat_map.append({ "seat_number": seat_data["seat_number"], "row": seat_data["row"], "column": seat_data["column"], "is_available": not is_booked, "price_tier": seat_data["price_tier"], "price": seat_data.get("price", 15.00) }) showtime = self.showtimes[showtime_id] theater = self.theaters.get(showtime.theater_id) movie = self.movies.get(showtime.movie_id) result = { "showtime_id": showtime_id, "movie": movie.title if movie else "Unknown", "theater": theater.name if theater else "Unknown Theater", "date": showtime.date, "time": showtime.time, "seat_map": seat_map } return CallToolResult( content=[TextContent(type="text", text=json.dumps(result, indent=2))] )
  • Alternative handler implementation (FastMCP version) for get_seat_map tool with identical core logic to the main server.
    def _get_seat_map(showtime_id: str) -> str: """Internal implementation of get_seat_map""" if not showtime_id or showtime_id not in showtimes: return json.dumps({"error": "Invalid showtime ID"}) # Get seats for this showtime seats = seats_data.get(showtime_id, []) seat_map = [] for seat_data in seats: # Check if seat is already booked is_booked = any( seat_data["seat_number"] in booking.seats and booking.status == "confirmed" for booking in bookings.values() if booking.showtime_id == showtime_id ) seat_map.append({ "seat_number": seat_data["seat_number"], "row": seat_data["row"], "column": seat_data["column"], "is_available": not is_booked, "price_tier": seat_data["price_tier"], "price": seat_data.get("price", 15.00) }) showtime = showtimes[showtime_id] theater = theaters.get(showtime.theater_id) movie = movies.get(showtime.movie_id) result = { "showtime_id": showtime_id, "movie": movie.title if movie else "Unknown", "theater": theater.name if theater else "Unknown Theater", "date": showtime.date, "time": showtime.time, "seat_map": seat_map } return json.dumps(result, indent=2)
  • Input schema definition for get_seat_map tool registered in list_tools handler.
    Tool( name="get_seat_map", description="Displays available and reserved seats for a specific showtime", inputSchema={ "type": "object", "properties": { "showtime_id": {"type": "string", "description": "Showtime ID"} }, "required": ["showtime_id"] } ),
  • Tool registration using FastMCP @mcp.tool() decorator, which delegates to internal _get_seat_map handler.
    @mcp.tool() def get_seat_map(showtime_id: str) -> str: """ Displays available and reserved seats for a specific showtime. Args: showtime_id: Showtime ID (e.g., "st001") Returns: JSON string with seat availability map """ return _get_seat_map(showtime_id)
  • Dispatch/registration logic in call_tool handler that routes get_seat_map requests to the _get_seat_map implementation.
    elif request.name == "get_seat_map": return await self._get_seat_map(request.arguments)

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/hi5d/amc-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server