Skip to main content
Glama
ChronulusAI

Chronulus MCP Server

Official

reuse_prediction_agent_and_get_prediction

Get probability predictions for binary outcomes using an existing Chronulus prediction agent. Receive consensus estimates with expert explanations and confidence intervals.

Instructions

This tool provides prediction input data to a previously created Chronulus BinaryPredictor agent and returns the consensus a prediction from a panel of experts along with their individual estimates and text explanations. The agent also returns the alpha and beta parameters for a Beta distribution that allows you to estimate the confidence interval of its consensus probability estimate.

When to use this tool:

  • Use this tool to request a prediction from a Chronulus prediction agent that you have already created and when your input data model is unchanged

  • Use this tool to request a probability estimate from an existing prediction agent in a situation when there is a binary outcome

  • This tool is specifically made to estimate the probability of an event occurring and not occurring and does not require historical data

How to use this tool:

  • First, make sure you have a session_id for the prediction use case.

  • Next, think about the features / characteristics most suitable for producing the requested prediction and then create an input_data_model that corresponds to the input_data you will provide for the thing or event being predicted.

  • Remember to pass all relevant information to Chronulus including text and images provided by the user.

  • If a user gives you files about a thing you are forecasting or predicting, you should pass these as inputs to the agent using one of the following types:

    • ImageFromFile

    • List[ImageFromFile]

    • TextFromFile

    • List[TextFromFile]

    • PdfFromFile

    • List[PdfFromFile]

  • If you have a large amount of text (over 500 words) to pass to the agent, you should use the Text or List[Text] field types

  • Finally, provide the number of experts to consult. The minimum and default number is 2, but users may request up to 30 30 opinions in situations where reproducibility and risk sensitively is of the utmost importance. In most cases, 2 to 5 experts is sufficient.

How to use this tool:

  • First, make sure you have an agent_id for the prediction agent. The agent is already attached to the correct session. So you do not need to provide a session_id.

  • Next, reference the input data model that you previously used with the agent and create new input data for the item being predicted that aligns with the previously specified input data model

  • Remember to pass all relevant information to Chronulus including text and images provided by the user.

  • If a user gives you files about a thing you are forecasting or predicting, you should pass these as inputs to the agent using one of the following types:

    • ImageFromFile

    • List[ImageFromFile]

    • TextFromFile

    • List[TextFromFile]

    • PdfFromFile

    • List[PdfFromFile]

  • If you have a large amount of text (over 500 words) to pass to the agent, you should use the Text or List[Text] field types

  • Finally, provide the number of experts to consult. The minimum and default number is 2, but users may request up to 30 30 opinions in situations where reproducibility and risk sensitively is of the utmost importance. In most cases, 2 to 5 experts is sufficient.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
agent_idYesThe agent_id for the forecasting or prediction use case and previously defined input_data_model
input_dataYesThe forecast inputs that you will pass to the chronulus agent to make the prediction. The keys of the dict should correspond to the InputField name you provided in input_fields.
num_expertsYesThe number of experts to consult when forming consensus

Implementation Reference

  • The async handler function implementing the core logic of the tool: loads a pre-existing BinaryPredictor agent by ID, processes input data into the agent's input type, queues a prediction request with the specified number of experts, retrieves the prediction set, and returns structured results including expert opinions and probability.
    async def reuse_prediction_agent_and_get_prediction(
            agent_id: Annotated[str, Field(description="The agent_id for the forecasting or prediction use case and previously defined input_data_model")],
            input_data: Annotated[Dict[str, Union[str, dict, List[dict]]], Field(
                description="The forecast inputs that you will pass to the chronulus agent to make the prediction. The keys of the dict should correspond to the InputField name you provided in input_fields.")],
            num_experts: Annotated[int, Field(description="The number of experts to consult when forming consensus")],
    
    ) -> Union[str, Dict[str, Union[dict, str]]]:
        """Queues and retrieves a binary event prediction from Chronulus with a previously created agent_id
    
        This tool provides a prediction input to a previous created Chronulus BinaryPredictor agent and returns the
        prediction data and text explanations from each of the experts consulted by the agent.
    
        Args:
            agent_id (str): The agent_id for the forecasting or prediction use case and previously defined input_data_model
            input_data (Dict[str, Union[str, dict, List[dict]]]): The forecast inputs that you will pass to the chronulus agent to make the prediction. The keys of the dict should correspond to the InputField name you provided in input_fields.
            num_experts (int): The number of experts to consult when forming consensus.
    
        Returns:
            Union[str, Dict[str, Union[dict, str]]]: a dictionary with prediction data, a text explanation of the predictions, agent_id, and probability estimate.
        """
    
        agent = BinaryPredictor.load_from_saved_estimator(estimator_id=agent_id, verbose=False)
        item = agent.input_type(**input_data)
    
        try:
            req = agent.queue(item, num_experts=num_experts, note_length=(5,10))
        except Exception as e:
            return f"""Error at nf_agent: {str(e)}"""
    
        try:
            prediction_set = agent.get_request_predictions(req.request_id)
            return {
                "agent_id": agent.estimator_id,
                "request_id": req.request_id,
                "beta_params": prediction_set.beta_params,
                'expert_opinions': [p.text for p in prediction_set],
                'probability': prediction_set.prob_a}
    
        except Exception as e:
            return f"""Error on prediction: {str(e)}"""
  • Registers the 'reuse_prediction_agent_and_get_prediction' tool with the FastMCP server instance, associating it with a detailed description string.
    mcp.add_tool(reuse_prediction_agent_and_get_prediction, description=REUSE_AGENT_AND_GET_PREDICTION_DESCRIPTION)
  • Pydantic schema definitions for the tool's input parameters using Annotated types with Field descriptions, defining agent_id (str), input_data (Dict), and num_experts (int). The function docstring also provides additional schema details including return type.
    agent_id: Annotated[str, Field(description="The agent_id for the forecasting or prediction use case and previously defined input_data_model")],
    input_data: Annotated[Dict[str, Union[str, dict, List[dict]]], Field(
        description="The forecast inputs that you will pass to the chronulus agent to make the prediction. The keys of the dict should correspond to the InputField name you provided in input_fields.")],
    num_experts: Annotated[int, Field(description="The number of experts to consult when forming consensus")],
  • Imports the handler function from predictor.py into the __init__.py module for use in tool registration.
    from chronulus_mcp.agent.predictor import create_prediction_agent_and_get_predictions, reuse_prediction_agent_and_get_prediction
  • Detailed description string for the tool, used in registration, providing usage instructions, when to use, and input guidelines including file types.
    REUSE_AGENT_AND_GET_PREDICTION_DESCRIPTION = f"""
    This tool provides prediction input data to a previously created Chronulus BinaryPredictor agent and returns the 
    consensus a prediction from a panel of experts along with their individual estimates and text explanations. The agent 
    also returns the alpha and beta parameters for a Beta distribution that allows you to estimate the confidence interval 
    of its consensus probability estimate.
    
    When to use this tool:
    - Use this tool to request a prediction from a Chronulus prediction agent that you have already created and when your 
    input data model is unchanged
    - Use this tool to request a probability estimate from an existing prediction agent in a situation when there is a binary outcome
    - This tool is specifically made to estimate the probability of an event occurring and not occurring and does not 
    require historical data
    
    How to use this tool:
    - First, make sure you have a session_id for the prediction use case.
    - Next, think about the features / characteristics most suitable for producing the requested prediction and then 
    create an input_data_model that corresponds to the input_data you will provide for the thing or event being predicted.
    {FILE_TYPE_INSTRUCTIONS}
    - Finally, provide the number of experts to consult. The minimum and default number is 2, but users may request up to 30
    30 opinions in situations where reproducibility and risk sensitively is of the utmost importance. In most cases, 2 to 5 
    experts is sufficient. 
    
    How to use this tool:
    - First, make sure you have an agent_id for the prediction agent. The agent is already attached to the correct session. 
    So you do not need to provide a session_id.
    - Next, reference the input data model that you previously used with the agent and create new input data for the item 
    being predicted that aligns with the previously specified input data model
    {FILE_TYPE_INSTRUCTIONS}
    - Finally, provide the number of experts to consult. The minimum and default number is 2, but users may request up to 30
    30 opinions in situations where reproducibility and risk sensitively is of the utmost importance. In most cases, 2 to 5 
    experts is sufficient. 
    """
Behavior4/5

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

With no annotations provided, the description carries full burden and adds significant behavioral context beyond the input schema. It explains the output includes 'consensus prediction', 'individual estimates and text explanations', and 'alpha and beta parameters for a Beta distribution' for confidence intervals. However, it lacks details on error handling, rate limits, or authentication needs, which are important for a prediction tool.

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

Conciseness2/5

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

The description is overly verbose and repetitive, with duplicated 'How to use this tool' sections that waste space. While it is well-structured with headings, many sentences could be condensed (e.g., file type lists are excessive). It fails to be front-loaded with critical information, burying key usage guidelines in lengthy instructions.

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 complexity (3 parameters, nested objects, no output schema, no annotations), the description is moderately complete. It covers purpose, usage, and behavioral output details, but lacks information on error cases, response format specifics, or performance considerations. Without an output schema, more detail on return values would be beneficial.

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

Parameters3/5

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

Schema description coverage is 100%, so the baseline is 3. The description adds some value by explaining 'agent_id' usage ('The agent is already attached to the correct session'), 'input_data' alignment with 'previously specified input data model', and 'num_experts' context ('minimum and default number is 2', 'up to 30', '2 to 5 experts is sufficient'), but these are mostly clarifications rather than essential semantics beyond the schema.

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

Purpose5/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: 'provides prediction input data to a previously created Chronulus BinaryPredictor agent and returns the consensus a prediction from a panel of experts along with their individual estimates and text explanations.' It specifies the verb ('provides', 'returns'), resource ('prediction agent'), and distinguishes it from siblings by emphasizing reuse of existing agents versus creation tools like 'create_prediction_agent_and_get_predictions'.

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

Usage Guidelines5/5

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

The description includes explicit 'When to use this tool' guidance: 'Use this tool to request a prediction from a Chronulus prediction agent that you have already created and when your input data model is unchanged' and 'Use this tool to request a probability estimate from an existing prediction agent in a situation when there is a binary outcome.' It also distinguishes when not to use it ('does not require historical data') and implies alternatives via sibling tool names like creation tools.

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/ChronulusAI/chronulus-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server