Skip to main content
Glama

time_series_forecast

Forecast future values from historical time-series data using automated ARIMA/SARIMA modeling, returning predictions, 95% confidence intervals, and an historical/forecast plot.

Instructions

time_series_forecast —— 时序组 · 时间序列预测(工具 17,简化实现)。

docstring = agent 使用说明书,与 statlab_mcp/docs/design/06_timeseries.md 同步维护。

参数: file_path (str): 本地数据文件(csv/tsv/xlsx/json) date_col / value_col (str): 日期列与数值列 horizon (int): 预测步数,1 <= horizon <= 样本量*50%(超限中文报错)

口径: auto_arima(pmdarima,stepwise=True, random_state=42, max_order=8)自动定阶; 季节可估判定(FFT 主频 period 且 n>=2*period)-> SARIMA 否则 ARIMA 并注明; 五项统一前置由 _common._prepare_series 完成(插值/聚合/时区等均入 metadata); 输出预测值 + 95% CI(predict(return_conf_int=True))+ 历史/预测图(image 顶层); 常数列退化为均值预测并注明。

示例: time_series_forecast("samples/timeseries.csv", date_col="date", value_col="value", horizon=14) inline 数据: 本工具支持可选 inline_data 参数(v1.2.0 起):与 file_path 二选一, 支持 records 数组或 {"header": [...], "rows": [[...], ...]} 对象两种形态; 规模上限/类型域/data_source 来源标注见 statlab_mcp/docs/SPEC.md 第 12 节。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
horizonNo
date_colNo
file_pathNo
value_colNo
inline_dataNo

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv1.2.0

TDQS

A4.1/5.0
Behavior5/5

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

With no annotations, the description carries the full behavioral burden and does so thoroughly: it discloses auto_arima settings, the FFT-based seasonal detection rule leading to SARIMA/ARIMA, common preprocessing via _prepare_series, the constant-column mean fallback, and the output format including a top-level __image__ plot. This gives an agent a clear model of what the tool will do internally and return.

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 organized into labeled sections (参数, 口径, 示例, inline 数据) and front-loads the core purpose, but it contains meta-commentary such as 'docstring = agent 使用说明书' and '工具 17,简化实现' that does not help an agent invoke the tool. The technical content is useful, yet the opening wastes a sentence on documentation maintenance rather than tool behavior.

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?

Given that there is no output schema, the description adequately communicates the return values (forecast + CI + chart) and key behavioral rules such as seasonal model selection and mean fallback. It does not specify the exact response JSON structure or edge-case error behavior for invalid files, but for a forecasting tool with documented parameters and an example, coverage is sufficient.

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

Parameters5/5

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

Schema description coverage is 0%, but the description compensates by explaining all five parameters: file_path with supported formats, date_col/value_col as date and value column names, horizon with its numeric bounds and error message, and inline_data with its two accepted shapes and exclusivity with file_path. It also includes a concrete example call.

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 identifies the tool as 时间序列预测 (time-series forecasting) and specifies the output as forecast values plus 95% CI and a historical/forecast chart, so the verb and resource are specific. However, it never explicitly distinguishes this tool from siblings like backtest_forecast or seasonal_decompose beyond the name and output description.

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

Usage Guidelines3/5

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

The description provides input constraints such as accepted file formats, horizon bounds, and the file_path/inline_data mutual exclusivity, which implies when the tool is applicable. It does not explicitly state when to use this tool versus alternatives such as backtest_forecast or trend_analysis, so guidance is implied rather than direct.

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

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/good-boy4069/statlab-mcp'

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