Skip to main content
Glama

search_games

Find video games in the IGDB database by entering search terms, retrieving details like ratings, release dates, and platforms.

Instructions

Search for games in the IGDB database

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch term for finding games
fieldsNoComma-separated list of fields to returnname,rating,rating_count,first_release_date,platforms.name
limitNoMaximum number of results to return

Implementation Reference

  • Registration of the 'search_games' tool using the @mcp.tool decorator, specifying name, title, and description.
    @mcp.tool( name="search_games", title="Search Games", description="Search for games in the IGDB database" )
  • The handler function implementing the logic for 'search_games': constructs an Apicalypse search query for the IGDB games endpoint and executes it via the IGDB client.
    async def search_games( query: Annotated[str, Field(description="Search term for finding games")], ctx: Context, fields: Annotated[ str, Field(description="Comma-separated list of fields to return") ] = "name,rating,rating_count,first_release_date,platforms.name", limit: Annotated[ int, Field(description="Maximum number of results to return", ge=1, le=500) ] = 10, ) -> List[Dict[str, Any]]: """ Search for games in the IGDB database. Args: query: Search term for finding games ctx: Context for accessing session configuration fields: Comma-separated list of fields to return limit: Maximum number of results to return (default: 10, max: 500) Returns: List of games matching the search criteria """ igdb_client = get_igdb_client(ctx) search_query = f'search "{query}"; fields {fields}; limit {limit};' return await igdb_client.make_request("games", search_query)
  • Input schema definitions for the search_games tool parameters using Pydantic Field annotations, including descriptions, defaults, and constraints.
    query: Annotated[str, Field(description="Search term for finding games")], ctx: Context, fields: Annotated[ str, Field(description="Comma-separated list of fields to return") ] = "name,rating,rating_count,first_release_date,platforms.name", limit: Annotated[ int, Field(description="Maximum number of results to return", ge=1, le=500) ] = 10, ) -> List[Dict[str, Any]]:

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/bielacki/igdb-mcp-server'

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