Skip to main content
Glama
ChronulusAI

Chronulus MCP Server

Official

rescale_forecast

Convert normalized forecast predictions (0-1 range) to specific min-max values required for practical applications, adjusting units when necessary.

Instructions

A tool that rescales the prediction data (values between 0 and 1) from the NormalizedForecaster agent to scale required for a use case

When to use this tool:

  • Use this tool when there is enough information from the user or use cases to determine a reasonable min and max for the forecast predictions

  • Do not attempt to rescale or denormalize the predictions on your own without using this tool.

  • Also, if the best min and max for the use case is 0 and 1, then no rescaling is needed since that is already the scale of the predictions.

  • If a user requests to convert from probabilities to a unit in levels, be sure to caveat your use of this tool by noting that probabilities do not always scale uniformly to levels. Rescaling can be used as a rough first-pass estimate. But for best results, it would be better to start a new Chronulus forecasting use case predicting in levels from the start.

How to use this tool:

  • To use this tool present prediction_id from the normalized prediction and the min and max as floats

  • If the user is also changing units, consider if the units will be inverted and set the inverse scale to True if needed.

  • When plotting the rescaled predictions, use a Rechart time series plot with the appropriate axes labeled and include the chronulus prediction explanation as a caption below the plot.

  • If you would like to add additional notes about the scaled series, put these below the original prediction explanation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
prediction_idYesThe prediction_id from a prediction result
y_minYesThe expected smallest value for the use case. E.g., for product sales, 0 would be the least possible value for sales.
y_maxYesThe expected largest value for the use case. E.g., for product sales, 0 would be the largest possible value would be given by the user or determined from this history of sales for the product in question or a similar product.
invert_scaleNoSet this flag to true if the scale of the new units will run in the opposite direction from the inputs.

Implementation Reference

  • The primary handler function that executes the rescale_forecast tool. It takes a prediction_id, scaling parameters (y_min, y_max, invert_scale), retrieves the normalized forecast, rescales it using RescaledForecast, and returns the rescaled data rows.
    async def rescale_forecast(
        prediction_id: Annotated[str, Field(description="The prediction_id from a prediction result")],
        y_min: Annotated[float, Field(description="The expected smallest value for the use case. E.g., for product sales, 0 would be the least possible value for sales.")],
        y_max: Annotated[float, Field(description="The expected largest value for the use case. E.g., for product sales, 0 would be the largest possible value would be given by the user or determined from this history of sales for the product in question or a similar product.")],
        invert_scale: Annotated[bool, Field(description="Set this flag to true if the scale of the new units will run in the opposite direction from the inputs.", default=False)],
    ) -> List[dict]:
        """Rescales prediction data from the NormalizedForecaster agent
    
        Args:
            prediction_id (str) : The prediction_id for the prediction you would like to rescale as returned by the forecasting agent
            y_min (float) : The expected smallest value for the use case. E.g., for product sales, 0 would be the least possible value for sales.
            y_max (float) : The expected largest value for the use case. E.g., for product sales, 0 would be the largest possible value would be given by the user or determined from this history of sales for the product in question or a similar product.
            invert_scale (bool): Set this flag to true if the scale of the new units will run in the opposite direction from the inputs.
    
        Returns:
            List[dict] : The prediction data rescaled to suit the use case
        """
    
        normalized_forecast = NormalizedForecaster.get_prediction_static(prediction_id)
        rescaled_forecast = RescaledForecast.from_forecast(
            forecast=normalized_forecast,
            y_min=y_min,
            y_max=y_max,
            invert_scale=invert_scale
        )
    
        return [DataRow(dt=row.get('date',row.get('datetime')), y_hat=row.get('y_hat')).model_dump() for row in rescaled_forecast.to_json(orient='rows')]
  • Registers the rescale_forecast function as an MCP tool with its description.
    mcp.add_tool(rescale_forecast, description=RESCALE_PREDICTIONS_DESCRIPTION)
  • Imports the rescale_forecast function for use in the MCP server.
    from chronulus_mcp.agent.forecaster import create_forecasting_agent_and_get_forecast, reuse_forecasting_agent_and_get_forecast, rescale_forecast
Behavior4/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 effectively describes the tool's behavior: it rescales normalized predictions, requires prediction_id and min/max values, handles unit inversion via invert_scale flag, and includes usage caveats about probability scaling. However, it doesn't mention error conditions, rate limits, or authentication needs, which would be helpful for a mutation tool.

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

Conciseness3/5

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

The description is structured with clear sections ('When to use this tool', 'How to use this tool'), which is helpful. However, it includes implementation details that don't belong in a tool description (plotting instructions with Rechart, adding notes below explanations). These sentences don't earn their place in a tool definition and make it less concise than ideal.

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

Completeness4/5

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

For a mutation tool with no annotations and no output schema, the description does a good job covering purpose, usage, and parameters. It explains the transformation behavior and includes important caveats about probability scaling. The main gap is lack of information about return values or error handling, which would be needed for full completeness.

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 schema already documents all parameters thoroughly. The description adds minimal value beyond the schema: it mentions presenting prediction_id and min/max as floats, and suggests considering unit inversion for invert_scale. This doesn't significantly enhance understanding beyond what the schema provides, meeting the baseline for high schema coverage.

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: 'rescales the prediction data (values between 0 and 1) from the NormalizedForecaster agent to scale required for a use case.' It specifies the verb ('rescales'), resource ('prediction data'), and distinguishes from siblings by mentioning the NormalizedForecaster agent, which none of the sibling tools reference. This is specific and well-differentiated.

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 provides explicit guidance in a dedicated 'When to use this tool' section. It gives clear conditions for when to use (enough information to determine min/max), when not to use (if min/max are 0 and 1), and alternatives (starting a new Chronulus forecasting use case for better results when converting probabilities to levels). This is comprehensive usage guidance.

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