edit_question
Modify details of a prediction question on Fatebook. Update fields like title, resolve-by date, and notes to keep forecasts accurate and organized. Requires a valid question ID.
Instructions
Edit a Fatebook question
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| apiKey | No | ||
| notes | No | ||
| questionId | Yes | ||
| resolveBy | No | ||
| title | No |
Implementation Reference
- main.py:363-403 (handler)The primary handler implementation for the 'edit_question' MCP tool. This async function handles editing a Fatebook question by making a PATCH request to the Fatebook API endpoint '/api/v0/editQuestion'. It supports optional updates to title, resolveBy date, and notes. Uses FastMCP's Context for error logging and validates API key.@mcp.tool() async def edit_question( ctx: Context, questionId: str, apiKey: str = "", title: str = "", resolveBy: str = "", notes: str = "", ) -> bool: """Edit a Fatebook question""" 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)" ) data = {"questionId": questionId, "apiKey": api_key} # Add optional parameters only if provided if title: data["title"] = title if resolveBy: data["resolveBy"] = resolveBy if notes: data["notes"] = notes try: async with httpx.AsyncClient() as client: response = await client.patch("https://fatebook.io/api/v0/editQuestion", 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