Skip to main content
Glama

resolve_question

Resolve Fatebook predictions with YES/NO/AMBIGUOUS outcomes by specifying question ID, resolution, and type. Streamlines decision tracking for AI assistants.

Instructions

Resolve a Fatebook question with YES/NO/AMBIGUOUS resolution

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
apiKeyNo
questionIdYes
questionTypeYes
resolutionYes

Implementation Reference

  • main.py:153-191 (handler)
    The primary handler function for the 'resolve_question' MCP tool. It validates the resolution value, constructs the API request, and calls the Fatebook API to resolve the question.
    @mcp.tool() async def resolve_question( ctx: Context, questionId: str, resolution: str, questionType: str, apiKey: str = "" ) -> bool: """Resolve a Fatebook question with YES/NO/AMBIGUOUS resolution""" api_key = apiKey or os.getenv("FATEBOOK_API_KEY") if not api_key: await ctx.error("API key is required but not provided") raise ValueError( "API key is required (provide as parameter or set FATEBOOK_API_KEY environment variable)" ) # Validate resolution parameter valid_resolutions = ["YES", "NO", "AMBIGUOUS"] if resolution not in valid_resolutions: await ctx.error(f"Invalid resolution parameter: {resolution}") raise ValueError(f"resolution must be one of {valid_resolutions}") data = { "questionId": questionId, "resolution": resolution, "questionType": questionType, "apiKey": api_key, } try: async with httpx.AsyncClient() as client: response = await client.post("https://fatebook.io/api/v0/resolveQuestion", json=data) response.raise_for_status() return True except httpx.HTTPError as e: await ctx.error(f"HTTP error occurred: {e}") raise except Exception as e: await ctx.error(f"Unexpected error occurred: {e}") raise
  • Secondary/alternative implementation of the resolve_question handler in the package __main__.py file, lacking Context parameter and logging.
    async def resolve_question( questionId: str, resolution: str, questionType: str, apiKey: str = "" ) -> bool: """Resolve a Fatebook question with YES/NO/AMBIGUOUS resolution""" api_key = apiKey or os.getenv("FATEBOOK_API_KEY") if not api_key: raise ValueError( "API key is required (provide as parameter or set FATEBOOK_API_KEY environment variable)" ) # Validate resolution parameter valid_resolutions = ["YES", "NO", "AMBIGUOUS"] if resolution not in valid_resolutions: raise ValueError(f"resolution must be one of {valid_resolutions}") data = { "questionId": questionId, "resolution": resolution, "questionType": questionType, "apiKey": api_key, } try: async with httpx.AsyncClient() as client: response = await client.post("https://fatebook.io/api/v0/resolveQuestion", json=data) response.raise_for_status() return True except httpx.HTTPError: raise except Exception: raise
  • Pydantic model definition in Question class that specifies the valid resolution values matching the tool's validation.
    resolution: Optional[Literal["YES", "NO", "AMBIGUOUS"]] = None

Other Tools

Related Tools

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/an1lam/fatebook-mcp'

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