Skip to main content
Glama
hi5d
by hi5d

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
NameRequiredDescriptionDefault
locationYes

Implementation Reference

  • 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"]
        }
    ),
  • 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))]
        )
  • 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)
  • 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)

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