Skip to main content
Glama

delete_question

Remove a prediction question from Fatebook to manage your forecast history. Specify the question ID to delete it from the tracking platform.

Instructions

Delete a Fatebook question

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
questionIdYes
apiKeyNo

Implementation Reference

  • main.py:334-361 (handler)
    Primary handler implementation for the 'delete_question' MCP tool. Decorated with @mcp.tool() for automatic registration and schema inference. Makes DELETE request to Fatebook API endpoint.
    @mcp.tool()
    async def delete_question(ctx: Context, questionId: str, apiKey: str = "") -> bool:
        """Delete 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)"
            )
    
        params = {"questionId": questionId, "apiKey": api_key}
    
        try:
            async with httpx.AsyncClient() as client:
                response = await client.delete(
                    "https://fatebook.io/api/v0/deleteQuestion", params=params
                )
                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
  • Alternative handler implementation for the 'delete_question' tool in the package __main__.py file. Similar logic but lacks Context parameter and detailed logging.
    @mcp.tool()
    async def delete_question(questionId: str, apiKey: str = "") -> bool:
        """Delete a Fatebook question"""
    
        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)"
            )
    
        params = {"questionId": questionId, "apiKey": api_key}
    
        try:
            async with httpx.AsyncClient() as client:
                response = await client.delete(
                    "https://fatebook.io/api/v0/deleteQuestion", params=params
                )
                response.raise_for_status()
                return True
    
        except httpx.HTTPError:
            raise
        except Exception:
            raise
  • main.py:334-334 (registration)
    The @mcp.tool() decorator registers the delete_question function as an MCP tool, inferring input/output schemas from type annotations.
    @mcp.tool()
  • The @mcp.tool() decorator registers the function in the package version.
    @mcp.tool()

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