get_game_details
Retrieve detailed information about a specific video game from IGDB, including ratings, platforms, genres, release dates, and company involvement.
Instructions
Retrieve detailed information about a specific game from IGDB
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| game_id | Yes | The IGDB ID of the game | |
| fields | No | Comma-separated list of fields to return | id,slug,name,rating,rating_count,hypes,first_release_date,platforms.name,genres.name,status,cover.url,summary,involved_companies.company.name,involved_companies.developer,involved_companies.publisher |
Implementation Reference
- src/igdb_mcp_server/server.py:192-220 (handler)The main asynchronous handler function that implements the get_game_details tool. It retrieves detailed game information from the IGDB API by game ID using a dynamically constructed query.async def get_game_details( game_id: Annotated[int, Field(description="The IGDB ID of the game")], ctx: Context, fields: Annotated[ Optional[str], Field(description="Comma-separated list of fields to return"), ] = "id,slug,name,rating,rating_count,hypes,first_release_date,platforms.name,genres.name,status,cover.url,summary,involved_companies.company.name,involved_companies.developer,involved_companies.publisher", ) -> Dict[str, Any]: """ Get detailed information about a specific game. Args: game_id: The IGDB ID of the game ctx: Context for accessing session configuration fields: Comma-separated list of fields to return (default: all fields) Returns: Detailed information about the game """ igdb_client = get_igdb_client(ctx) query = f"fields {fields}; where id = {game_id};" results = await igdb_client.make_request("games", query) if not results: raise ValueError(f"No game found with ID {game_id}") return results[0]
- src/igdb_mcp_server/server.py:187-191 (registration)The FastMCP @mcp.tool decorator that registers the get_game_details function as a tool, specifying its name, title, and description.@mcp.tool( name="get_game_details", title="Get Game Details", description="Retrieve detailed information about a specific game from IGDB" )
- Input schema definition using Pydantic's Annotated and Field for parameter validation and documentation (game_id, ctx, fields). The default fields parameter specifies common game details to fetch.game_id: Annotated[int, Field(description="The IGDB ID of the game")], ctx: Context, fields: Annotated[ Optional[str], Field(description="Comma-separated list of fields to return"), ] = "id,slug,name,rating,rating_count,hypes,first_release_date,platforms.name,genres.name,status,cover.url,summary,involved_companies.company.name,involved_companies.developer,involved_companies.publisher", ) -> Dict[str, Any]: