Skip to main content
Glama
hi5d
by hi5d

get_seat_map

View available and reserved seats for a specific AMC showtime to select your preferred seating before 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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Handler function that implements the get_seat_map tool logic: validates showtime_id, loads seat data, checks availability against existing bookings, constructs seat map, adds context from showtime/theater/movie, returns JSON in CallToolResult.
    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))]
        )
  • Core internal implementation of get_seat_map: identical logic to server.py version, validates showtime, builds seat map with availability, returns JSON string.
    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)
  • MCP tool registration for get_seat_map, defining name, description, and input schema requiring 'showtime_id'.
    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"]
        }
    ),
  • FastMCP tool registration and thin handler for get_seat_map using @mcp.tool() decorator, with type hints and docstring providing schema info, delegates to internal _get_seat_map.
    @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)
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It mentions the return format ('JSON string with seat availability map'), which is helpful, but lacks critical behavioral details such as whether this is a read-only operation, potential rate limits, authentication requirements, or error conditions. The description doesn't contradict annotations (none exist).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded: the first sentence states the core purpose, followed by structured 'Args' and 'Returns' sections. Every sentence earns its place with no wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (single parameter, read-focused operation), the description is reasonably complete. It covers purpose, parameter, and return format. However, with no annotations and an output schema present (though not detailed here), it could benefit from more behavioral context like error handling or data freshness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It provides the parameter name ('showtime_id') and an example value ('st001'), adding meaning beyond the bare schema. However, it doesn't explain format constraints or validation rules beyond the example.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with specific verbs ('displays') and resources ('available and reserved seats for a specific showtime'). It distinguishes from siblings like 'get_showtimes' (which lists showtimes) and 'book_seats' (which reserves seats).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage when seat availability is needed for a showtime, but provides no explicit guidance on when to use this tool versus alternatives like 'get_showtimes' (for showtime listings) or 'book_seats' (for seat booking). No exclusions or prerequisites are mentioned.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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