get_countries
Retrieve a complete list of countries from IMDb's database for filtering or reference purposes in media analysis.
Instructions
Get all countries. Returns: JSON object containing all countries.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "get_countries"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- src/imdb_mcp_server/tools.py:173-183 (handler)The handler function for the 'get_countries' tool. It makes an API request to the IMDb countries endpoint, handles the response, and returns the countries data as a JSON string.
@mcp.tool() async def get_countries(ctx: Context) -> str: """Get all countries. Returns: JSON object containing all countries. """ countries_url = f"{BASE_URL}/countries" countries_data = await make_imdb_request(countries_url, {}, ctx) if not countries_data: return "Unable to fetch countries data." return json.dumps(countries_data, indent=4)