Skip to main content
Glama

get_question

Retrieve detailed information about a specific prediction question from Fatebook, including all available structured data fields for tracking forecasts.

Instructions

Get detailed information about a specific Fatebook question

Returns a structured Question object with all available fields.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
questionIdYes
apiKeyNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
idNo
tagsNoTags associated with the question
typeNoBINARY
notesNo
titleYes
commentsNoComments on the question
resolvedNo
unlistedNo
createdAtYes
forecastsNoList of forecasts on this question
resolveByYes
resolutionNo
resolvedAtNo
questionScoresNo
shareWithEmailNo
shareWithListsNo
sharedPubliclyNo
hideForecastsUntilNo
yourLatestPredictionNo

Implementation Reference

  • The handler function for the 'get_question' tool. It makes an API call to Fatebook's getQuestion endpoint, adds the question ID, parses the response into a Question model, and returns it. Registered via @mcp.tool() decorator.
    @mcp.tool()
    async def get_question(ctx: Context, questionId: str, apiKey: str = "") -> Question:
        """Get detailed information about a specific Fatebook question
    
        Returns a structured Question object with all available fields.
        """
    
        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: ParamsType = {"apiKey": api_key, "questionId": questionId}
    
        await ctx.debug(f"Making API request for question {questionId}")
    
        try:
            async with httpx.AsyncClient() as client:
                response = await client.get("https://fatebook.io/api/v0/getQuestion", params=params)
                response.raise_for_status()
    
                question_data = response.json()
                await ctx.info(f"Successfully retrieved question {questionId}")
    
                # Add the ID to the data since the API doesn't return it
                question_data["id"] = questionId
    
                # Parse as Question model and return it
                question = Question(**question_data)
                return question
    
        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
  • Pydantic model defining the input/output schema for the Question object returned by the get_question tool. Includes core fields, timestamps, resolution info, related data (forecasts, tags, comments), and API-specific fields.
    class Question(BaseModel):
        """Fatebook question model with optional fields for detailed responses"""
    
        # Core fields (id is optional since getQuestion doesn't return it)
        id: Optional[str] = None
        title: str
        type: Literal["BINARY", "NUMERIC", "MULTIPLE_CHOICE"] = "BINARY"
        resolved: bool = False
    
        # Timestamps
        created_at: datetime = Field(alias="createdAt")
        resolve_by: datetime = Field(alias="resolveBy")
        resolved_at: Optional[datetime] = Field(None, alias="resolvedAt")
    
        # Resolution information
        resolution: Optional[Literal["YES", "NO", "AMBIGUOUS"]] = None
    
        # Additional content (typically in detailed view)
        notes: Optional[str] = None
    
        # Related data (typically in detailed view)
        forecasts: Optional[List[Forecast]] = Field(
            default=None, description="List of forecasts on this question"
        )
        tags: Optional[List[Tag]] = Field(default=None, description="Tags associated with the question")
        comments: Optional[List[Comment]] = Field(default=None, description="Comments on the question")
    
        # Visibility settings (typically in detailed view)
        shared_publicly: Optional[bool] = Field(None, alias="sharedPublicly")
        unlisted: Optional[bool] = None
        hide_forecasts_until: Optional[datetime] = Field(None, alias="hideForecastsUntil")
        share_with_lists: Optional[List[str]] = Field(None, alias="shareWithLists")
        share_with_email: Optional[List[str]] = Field(None, alias="shareWithEmail")
    
        # Additional fields from getQuestion endpoint
        your_latest_prediction: Optional[str] = Field(None, alias="yourLatestPrediction")
        question_scores: Optional[List] = Field(None, alias="questionScores")
    
        class Config:
            populate_by_name = True
            by_alias = True  # Use aliases when serializing
  • Supporting MCP resource handler for accessing question data via URI 'question://{question_id}', similar logic to the tool handler.
    @mcp.resource("question://{question_id}")
    async def get_question_resource(question_id: str) -> Question:
        """Get detailed information about a specific Fatebook question as a resource
    
        Provides read-only access to question data for loading into LLM context.
        """
        api_key = os.getenv("FATEBOOK_API_KEY")
        if not api_key:
            raise ValueError("API key is required (set FATEBOOK_API_KEY environment variable)")
        params: ParamsType = {"apiKey": api_key, "questionId": question_id}
        async with httpx.AsyncClient() as client:
            response = await client.get("https://fatebook.io/api/v0/getQuestion", params=params)
            response.raise_for_status()
            question_data = response.json()
            # Add the ID to the data since the API doesn't return it
            question_data["id"] = question_id
            question = Question(**question_data)
            return question
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It states the tool 'Returns a structured Question object with all available fields' which provides some output information, but doesn't cover important aspects like authentication requirements (apiKey parameter exists but isn't explained), rate limits, error conditions, or whether this is a read-only operation. The description is minimal and leaves significant behavioral gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately concise with two sentences that get straight to the point. The first sentence states the purpose, the second describes the return value. There's no wasted language or unnecessary elaboration. However, it could be slightly improved by front-loading more critical information about parameters.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given that an output schema exists, the description doesn't need to explain return values in detail. However, for a tool with 2 parameters (0% schema coverage), no annotations, and siblings that perform similar operations on questions, the description is incomplete. It should provide more context about when to use this versus other question tools and explain the parameters, especially the apiKey.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate but fails to do so. The description mentions 'specific Fatebook question' which implies the 'questionId' parameter, but doesn't explain what format it expects or where to find it. It completely ignores the 'apiKey' parameter. With 2 parameters and 0% schema coverage, the description adds minimal semantic value beyond what's obvious from the tool name.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Get detailed information about a specific Fatebook question' - a specific verb ('Get') and resource ('Fatebook question'). It distinguishes from siblings like 'list_questions' (which lists multiple) by focusing on a single specific question. However, it doesn't explicitly contrast with 'edit_question' or 'resolve_question' which also operate on specific questions.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention when to use 'get_question' versus 'list_questions' (for multiple questions) or versus other question-specific tools like 'edit_question' or 'resolve_question'. There's no context about prerequisites, timing, or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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