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
| Name | Required | Description | Default |
|---|---|---|---|
| apiKey | No | ||
| questionId | Yes | ||
| questionType | Yes | ||
| resolution | Yes |
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
- src/fatebook_mcp/__main__.py:149-182 (handler)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
- src/fatebook_mcp/models.py:88-89 (schema)Pydantic model definition in Question class that specifies the valid resolution values matching the tool's validation.resolution: Optional[Literal["YES", "NO", "AMBIGUOUS"]] = None