Skip to main content
Glama

count_forecasts

Count predictions made by a specific user on Fatebook to track forecasting activity and history.

Instructions

Count forecasts for a specific user

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
userIdYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • main.py:405-426 (handler)
    The main handler function for the 'count_forecasts' MCP tool. Decorated with @mcp.tool() for automatic registration and execution. Calls the Fatebook API to count forecasts for the given userId and returns the integer count.
    @mcp.tool()
    async def count_forecasts(ctx: Context, userId: str) -> int:
        """Count forecasts for a specific user"""
    
        params = {"userId": userId}
    
        try:
            async with httpx.AsyncClient() as client:
                response = await client.get("https://fatebook.io/api/v0/countForecasts", params=params)
                response.raise_for_status()
    
                # Parse JSON response and return the count
                data = response.json()
                return int(data.get("count", 0))
    
        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
  • Package version handler function for the 'count_forecasts' MCP tool. Similar implementation without Context logging.
    @mcp.tool()
    async def count_forecasts(userId: str) -> int:
        """Count forecasts for a specific user"""
    
        params = {"userId": userId}
    
        try:
            async with httpx.AsyncClient() as client:
                response = await client.get("https://fatebook.io/api/v0/countForecasts", params=params)
                response.raise_for_status()
    
                # Parse JSON response and return the count
                data = response.json()
                return int(data.get("count", 0))
    
        except httpx.HTTPError:
            raise
        except Exception:
            raise
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It only states the action ('count forecasts') without any details on permissions, rate limits, return format, or side effects. For a tool with zero annotation coverage, this is inadequate, as it lacks critical operational context.

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

Conciseness5/5

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

The description is a single, efficient sentence with no wasted words, making it easy to parse. It's appropriately sized for a simple tool, though this conciseness comes at the cost of detail in other dimensions.

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 the tool's low complexity (one parameter) and the presence of an output schema (which handles return values), the description is minimally complete. However, with no annotations and poor parameter documentation, it lacks sufficient context for safe and effective use, scoring at the baseline of adequacy with clear gaps.

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?

The input schema has 0% description coverage, so the parameter 'userId' is undocumented in the schema. The description adds minimal semantics by implying it's used to specify a user, but it doesn't explain the format (e.g., string ID), constraints, or examples. This fails to compensate for the schema gap, leaving the parameter poorly understood.

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 verb 'count' and the resource 'forecasts', specifying the scope 'for a specific user'. However, it doesn't differentiate from potential sibling tools like 'list_questions' or 'get_question' that might also involve counting or retrieving data, so it doesn't reach the highest score.

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 minimal guidance by implying usage when counting forecasts for a user, but it offers no explicit when-to-use advice, no alternatives (e.g., vs. 'list_questions' for broader data), and no prerequisites. This leaves the agent with little context for tool selection.

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