You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
'List all available forecasting models and their capabilities. Returns information about Chronos2, TiRex, and other available models, including supported output types and features.',
93
-
inputSchema: {},
94
+
inputSchema: z.object({}).strict()asany,
94
95
},
95
96
async()=>{
96
97
constresult=awaitlistModels();
@@ -122,72 +123,23 @@ server.registerTool(
122
123
{
123
124
description:
124
125
'Perform time series forecasting using FAIM models. Supports both point forecasting (single value) and probabilistic forecasting (confidence intervals). Can handle univariate and multivariate time series data.',
125
-
inputSchema: {
126
-
type: 'object'asconst,
127
-
properties: {
128
-
model: {
129
-
type: 'string'asconst,
130
-
enum: ['chronos2','tirex'],
131
-
description:
132
-
'The forecasting model to use. Chronos2 is the general-purpose model. TiRex is an alternative with different characteristics.',
133
-
},
134
-
x: {
135
-
description:
136
-
'Time series data to forecast from. Can be a 1D array (single series), 2D array (multiple series or multivariate), or 3D array. 1D example: [1,2,3,4,5]. 2D example: [[1,2],[3,4],[5,6]].',
137
-
oneOf: [
138
-
{
139
-
type: 'array'asconst,
140
-
items: {type: 'number'asconst},
141
-
description: '1D array: single univariate time series',
142
-
},
143
-
{
144
-
type: 'array'asconst,
145
-
items: {
146
-
type: 'array'asconst,
147
-
items: {type: 'number'asconst},
148
-
},
149
-
description: '2D array: multiple timesteps with features',
150
-
},
151
-
{
152
-
type: 'array'asconst,
153
-
items: {
154
-
type: 'array'asconst,
155
-
items: {
156
-
type: 'array'asconst,
157
-
items: {type: 'number'asconst},
158
-
},
159
-
},
160
-
description: '3D array: batch of time series',
161
-
},
162
-
],
163
-
},
164
-
horizon: {
165
-
type: 'number'asconst,
166
-
description:
167
-
'Number of time steps to forecast into the future. Must be a positive integer. Example: 10 means predict the next 10 steps.',
168
-
},
169
-
output_type: {
170
-
type: 'string'asconst,
171
-
enum: ['point','quantiles'],
172
-
default: 'point',
173
-
description:
174
-
'Type of forecast output. "point" = single value per step (fastest). "quantiles" = confidence intervals (use for uncertainty).',
175
-
},
176
-
quantiles: {
177
-
type: 'array'asconst,
178
-
items: {type: 'number'asconst},
179
-
description:
180
-
'Quantile levels to compute (only used with output_type="quantiles"). Values between 0 and 1. Example: [0.1, 0.5, 0.9] for 10th, 50th, 90th percentiles.',
181
-
},
182
-
},
183
-
required: ['model','x','horizon']asconst,
184
-
}asany,
126
+
inputSchema: z.object({
127
+
model: z.enum(['chronos2','tirex']).describe('The forecasting model to use. Chronos2 is the general-purpose model. TiRex is an alternative with different characteristics.'),
128
+
x: z.union([
129
+
z.array(z.number()).describe('1D array: single univariate time series'),
130
+
z.array(z.array(z.number())).describe('2D array: multiple timesteps with features'),
131
+
z.array(z.array(z.array(z.number()))).describe('3D array: batch of time series'),
132
+
]).describe('Time series data to forecast from. Can be a 1D array (single series), 2D array (multiple series or multivariate), or 3D array.'),
133
+
horizon: z.number().describe('Number of time steps to forecast into the future. Must be a positive integer. Example: 10 means predict the next 10 steps.'),
134
+
output_type: z.enum(['point','quantiles']).default('point').describe('Type of forecast output. "point" = single value per step (fastest). "quantiles" = confidence intervals (use for uncertainty).'),
135
+
quantiles: z.array(z.number()).optional().describe('Quantile levels to compute (only used with output_type="quantiles"). Values between 0 and 1. Example: [0.1, 0.5, 0.9] for 10th, 50th, 90th percentiles.'),
136
+
}).strict()asany,
185
137
},
186
138
async(args: unknown)=>{
187
139
constresult=awaitforecast(args);
188
140
189
141
if(!result.success){
190
-
thrownewError(JSON.stringify(result.error));
142
+
thrownewError(result.error.message);
191
143
}
192
144
193
145
// Format response for MCP
@@ -217,7 +169,6 @@ async function main(): Promise<void> {
217
169
try{
218
170
// Initialize FAIM client before accepting requests
0 commit comments