Skip to main content
Glama

get_cast

Retrieve complete cast information for any movie using its IMDb ID to identify actors and their roles in the film.

Instructions

Get the cast of a movie from IMDb. Args: imdbId: The IMDb ID of the movie to get cast for. Returns: JSON object containing the cast of the movie.

Input Schema

NameRequiredDescriptionDefault
imdb_idYes

Input Schema (JSON Schema)

{ "properties": { "imdb_id": { "title": "Imdb Id", "type": "string" } }, "required": [ "imdb_id" ], "type": "object" }

Implementation Reference

  • Handler function for the 'get_cast' tool. Decorated with @mcp.tool() which registers it as an MCP tool. It constructs the API URL, calls make_imdb_request to fetch cast data for the given IMDb ID, and returns the JSON response or an error message.
    @mcp.tool() async def get_cast(imdb_id: str, ctx: Context) -> str: """Get the cast of a movie from IMDb. Args: imdbId: The IMDb ID of the movie to get cast for. Returns: JSON object containing the cast of the movie. """ cast_url = f"{BASE_URL}/{imdb_id}/cast" cast_data = await make_imdb_request(cast_url, {}, ctx) if not cast_data: return "Unable to fetch cast data for this movie or movie not found." return json.dumps(cast_data, indent=4)

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/uzaysozen/imdb-mcp-server'

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