get_writers
Retrieve the writers of any movie using its IMDb ID. This tool provides JSON data listing all credited writers for the specified film.
Instructions
Get the writers of a movie from IMDb. Args: imdbId: The IMDb ID of the movie to get writers for. Returns: JSON object containing the writers of the movie.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| imdb_id | Yes |
Input Schema (JSON Schema)
{
"properties": {
"imdb_id": {
"title": "Imdb Id",
"type": "string"
}
},
"required": [
"imdb_id"
],
"type": "object"
}
Implementation Reference
- src/imdb_mcp_server/tools.py:131-143 (handler)The main handler function for the 'get_writers' tool. It is decorated with @mcp.tool() which registers it as an MCP tool. Fetches writers information from the IMDb API endpoint for the given imdb_id and returns the data as formatted JSON.@mcp.tool() async def get_writers(imdb_id: str, ctx: Context) -> str: """Get the writers of a movie from IMDb. Args: imdbId: The IMDb ID of the movie to get writers for. Returns: JSON object containing the writers of the movie. """ writers_url = f"{BASE_URL}/{imdb_id}/writers" writers_data = await make_imdb_request(writers_url, {}, ctx) if not writers_data: return "Unable to fetch writers data for this movie or movie not found." return json.dumps(writers_data, indent=4)
- src/imdb_mcp_server/main.py:22-25 (registration)Calls register_tools(server) within the create_server function, which defines and registers all tools including get_writers via decorators.# Register all tools with the server register_tools(server) return server
- src/imdb_mcp_server/main.py:60-61 (registration)In stdio mode, creates the server and calls register_tools(server) to register all tools including get_writers.server = FastMCP("IMDb MCP Server") register_tools(server)