@withinfocus/tba-mcp-server 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +614 -0
- package/dist/index.d.ts +350 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2442 -0
- package/dist/index.js.map +1 -0
- package/package.json +68 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,2442 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
3
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
4
|
+
import { CallToolRequestSchema, ListToolsRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
export const TeamKeySchema = z
|
|
7
|
+
.string()
|
|
8
|
+
.regex(/^frc\d+$/, 'Team key must be in format frcXXXX');
|
|
9
|
+
export const EventKeySchema = z.string();
|
|
10
|
+
export const YearSchema = z
|
|
11
|
+
.number()
|
|
12
|
+
.int()
|
|
13
|
+
.min(1992)
|
|
14
|
+
.max(new Date().getFullYear() + 1);
|
|
15
|
+
export const TeamSchema = z.object({
|
|
16
|
+
key: z.string(),
|
|
17
|
+
team_number: z.number(),
|
|
18
|
+
nickname: z.string().nullish(),
|
|
19
|
+
name: z.string(),
|
|
20
|
+
city: z.string().nullish(),
|
|
21
|
+
state_prov: z.string().nullish(),
|
|
22
|
+
country: z.string().nullish(),
|
|
23
|
+
address: z.string().nullish(),
|
|
24
|
+
postal_code: z.string().nullish(),
|
|
25
|
+
gmaps_place_id: z.string().nullish(),
|
|
26
|
+
gmaps_url: z.string().nullish(),
|
|
27
|
+
lat: z.number().nullish(),
|
|
28
|
+
lng: z.number().nullish(),
|
|
29
|
+
location_name: z.string().nullish(),
|
|
30
|
+
website: z.string().nullish(),
|
|
31
|
+
rookie_year: z.number().nullish(),
|
|
32
|
+
motto: z.string().nullish(),
|
|
33
|
+
home_championship: z.record(z.string(), z.any()).nullish(),
|
|
34
|
+
});
|
|
35
|
+
export const EventSchema = z.object({
|
|
36
|
+
key: z.string(),
|
|
37
|
+
name: z.string(),
|
|
38
|
+
event_code: z.string(),
|
|
39
|
+
event_type: z.number(),
|
|
40
|
+
district: z
|
|
41
|
+
.object({
|
|
42
|
+
abbreviation: z.string(),
|
|
43
|
+
display_name: z.string(),
|
|
44
|
+
key: z.string(),
|
|
45
|
+
year: z.number(),
|
|
46
|
+
})
|
|
47
|
+
.nullish(),
|
|
48
|
+
city: z.string().nullish(),
|
|
49
|
+
state_prov: z.string().nullish(),
|
|
50
|
+
country: z.string().nullish(),
|
|
51
|
+
start_date: z.string(),
|
|
52
|
+
end_date: z.string(),
|
|
53
|
+
year: z.number(),
|
|
54
|
+
short_name: z.string().nullish(),
|
|
55
|
+
event_type_string: z.string(),
|
|
56
|
+
week: z.number().nullish(),
|
|
57
|
+
address: z.string().nullish(),
|
|
58
|
+
postal_code: z.string().nullish(),
|
|
59
|
+
gmaps_place_id: z.string().nullish(),
|
|
60
|
+
gmaps_url: z.string().nullish(),
|
|
61
|
+
lat: z.number().nullish(),
|
|
62
|
+
lng: z.number().nullish(),
|
|
63
|
+
location_name: z.string().nullish(),
|
|
64
|
+
timezone: z.string().nullish(),
|
|
65
|
+
website: z.string().nullish(),
|
|
66
|
+
first_event_id: z.string().nullish(),
|
|
67
|
+
first_event_code: z.string().nullish(),
|
|
68
|
+
webcasts: z
|
|
69
|
+
.array(z.object({
|
|
70
|
+
type: z.string(),
|
|
71
|
+
channel: z.string(),
|
|
72
|
+
date: z.string().nullish(),
|
|
73
|
+
file: z.string().nullish(),
|
|
74
|
+
}))
|
|
75
|
+
.nullish(),
|
|
76
|
+
division_keys: z.array(z.string()).nullish(),
|
|
77
|
+
parent_event_key: z.string().nullish(),
|
|
78
|
+
playoff_type: z.number().nullish(),
|
|
79
|
+
playoff_type_string: z.string().nullish(),
|
|
80
|
+
});
|
|
81
|
+
export const MatchSchema = z.object({
|
|
82
|
+
key: z.string(),
|
|
83
|
+
comp_level: z.string(),
|
|
84
|
+
set_number: z.number(),
|
|
85
|
+
match_number: z.number(),
|
|
86
|
+
alliances: z.object({
|
|
87
|
+
red: z.object({
|
|
88
|
+
score: z.number(),
|
|
89
|
+
team_keys: z.array(z.string()),
|
|
90
|
+
surrogate_team_keys: z.array(z.string()).nullish(),
|
|
91
|
+
dq_team_keys: z.array(z.string()).nullish(),
|
|
92
|
+
}),
|
|
93
|
+
blue: z.object({
|
|
94
|
+
score: z.number(),
|
|
95
|
+
team_keys: z.array(z.string()),
|
|
96
|
+
surrogate_team_keys: z.array(z.string()).nullish(),
|
|
97
|
+
dq_team_keys: z.array(z.string()).nullish(),
|
|
98
|
+
}),
|
|
99
|
+
}),
|
|
100
|
+
winning_alliance: z.string().nullish(),
|
|
101
|
+
event_key: z.string(),
|
|
102
|
+
time: z.number().nullish(),
|
|
103
|
+
actual_time: z.number().nullish(),
|
|
104
|
+
predicted_time: z.number().nullish(),
|
|
105
|
+
post_result_time: z.number().nullish(),
|
|
106
|
+
score_breakdown: z.record(z.string(), z.any()).nullish(),
|
|
107
|
+
videos: z
|
|
108
|
+
.array(z.object({
|
|
109
|
+
type: z.string(),
|
|
110
|
+
key: z.string(),
|
|
111
|
+
}))
|
|
112
|
+
.nullish(),
|
|
113
|
+
});
|
|
114
|
+
const AwardSchema = z.object({
|
|
115
|
+
name: z.string(),
|
|
116
|
+
award_type: z.number(),
|
|
117
|
+
event_key: z.string(),
|
|
118
|
+
recipient_list: z.array(z.object({
|
|
119
|
+
team_key: z.string().nullish(),
|
|
120
|
+
awardee: z.string().nullish(),
|
|
121
|
+
})),
|
|
122
|
+
year: z.number(),
|
|
123
|
+
});
|
|
124
|
+
const RankingSchema = z.object({
|
|
125
|
+
rankings: z.array(z.object({
|
|
126
|
+
team_key: z.string(),
|
|
127
|
+
rank: z.number(),
|
|
128
|
+
dq: z.number().nullish(),
|
|
129
|
+
matches_played: z.number(),
|
|
130
|
+
qual_average: z.number().nullish(),
|
|
131
|
+
record: z
|
|
132
|
+
.object({
|
|
133
|
+
losses: z.number(),
|
|
134
|
+
wins: z.number(),
|
|
135
|
+
ties: z.number(),
|
|
136
|
+
})
|
|
137
|
+
.nullish(),
|
|
138
|
+
extra_stats: z.array(z.number()).nullish(),
|
|
139
|
+
sort_orders: z.array(z.number()).nullish(),
|
|
140
|
+
})),
|
|
141
|
+
extra_stats_info: z
|
|
142
|
+
.array(z.object({
|
|
143
|
+
name: z.string(),
|
|
144
|
+
precision: z.number(),
|
|
145
|
+
}))
|
|
146
|
+
.nullish(),
|
|
147
|
+
sort_order_info: z
|
|
148
|
+
.array(z.object({
|
|
149
|
+
name: z.string(),
|
|
150
|
+
precision: z.number(),
|
|
151
|
+
}))
|
|
152
|
+
.nullish(),
|
|
153
|
+
});
|
|
154
|
+
const AllianceSchema = z.object({
|
|
155
|
+
name: z.string().nullish(),
|
|
156
|
+
backup: z
|
|
157
|
+
.object({
|
|
158
|
+
in: z.string().nullish(),
|
|
159
|
+
out: z.string().nullish(),
|
|
160
|
+
})
|
|
161
|
+
.nullish(),
|
|
162
|
+
declines: z.array(z.string()).nullish(),
|
|
163
|
+
picks: z.array(z.string()),
|
|
164
|
+
status: z
|
|
165
|
+
.object({
|
|
166
|
+
current_level_record: z
|
|
167
|
+
.object({
|
|
168
|
+
losses: z.number(),
|
|
169
|
+
ties: z.number(),
|
|
170
|
+
wins: z.number(),
|
|
171
|
+
})
|
|
172
|
+
.nullish(),
|
|
173
|
+
level: z.string().nullish(),
|
|
174
|
+
playoff_average: z.number().nullish(),
|
|
175
|
+
record: z
|
|
176
|
+
.object({
|
|
177
|
+
losses: z.number(),
|
|
178
|
+
ties: z.number(),
|
|
179
|
+
wins: z.number(),
|
|
180
|
+
})
|
|
181
|
+
.nullish(),
|
|
182
|
+
status: z.string().nullish(),
|
|
183
|
+
})
|
|
184
|
+
.nullish(),
|
|
185
|
+
});
|
|
186
|
+
const DistrictPointsSchema = z.object({
|
|
187
|
+
points: z.record(z.string(), z.object({
|
|
188
|
+
alliance_points: z.number(),
|
|
189
|
+
award_points: z.number(),
|
|
190
|
+
elim_points: z.number(),
|
|
191
|
+
qual_points: z.number(),
|
|
192
|
+
total: z.number(),
|
|
193
|
+
})),
|
|
194
|
+
tiebreakers: z
|
|
195
|
+
.record(z.string(), z.object({
|
|
196
|
+
highest_qual_scores: z.array(z.number()).nullish(),
|
|
197
|
+
qual_wins: z.number().nullish(),
|
|
198
|
+
}))
|
|
199
|
+
.nullish(),
|
|
200
|
+
});
|
|
201
|
+
const InsightsSchema = z.object({
|
|
202
|
+
qual: z.record(z.string(), z.any()).nullish(),
|
|
203
|
+
playoff: z.record(z.string(), z.any()).nullish(),
|
|
204
|
+
});
|
|
205
|
+
const MediaSchema = z.object({
|
|
206
|
+
type: z.string(),
|
|
207
|
+
foreign_key: z.string().nullish(),
|
|
208
|
+
details: z.record(z.string(), z.any()).nullish(),
|
|
209
|
+
preferred: z.boolean().nullish(),
|
|
210
|
+
direct_url: z.string().nullish(),
|
|
211
|
+
view_url: z.string().nullish(),
|
|
212
|
+
});
|
|
213
|
+
const RobotSchema = z.object({
|
|
214
|
+
year: z.number(),
|
|
215
|
+
robot_name: z.string(),
|
|
216
|
+
key: z.string(),
|
|
217
|
+
team_key: z.string(),
|
|
218
|
+
});
|
|
219
|
+
const DistrictSchema = z.object({
|
|
220
|
+
abbreviation: z.string(),
|
|
221
|
+
display_name: z.string(),
|
|
222
|
+
key: z.string(),
|
|
223
|
+
year: z.number(),
|
|
224
|
+
});
|
|
225
|
+
export const StatusSchema = z.object({
|
|
226
|
+
current_season: z.number(),
|
|
227
|
+
max_season: z.number(),
|
|
228
|
+
is_datafeed_down: z.boolean(),
|
|
229
|
+
down_events: z.array(z.string()),
|
|
230
|
+
ios: z.object({
|
|
231
|
+
latest_app_version: z.number(),
|
|
232
|
+
min_app_version: z.number(),
|
|
233
|
+
}),
|
|
234
|
+
android: z.object({
|
|
235
|
+
latest_app_version: z.number(),
|
|
236
|
+
min_app_version: z.number(),
|
|
237
|
+
}),
|
|
238
|
+
max_team_page: z.number(),
|
|
239
|
+
});
|
|
240
|
+
export const EventOPRsSchema = z.object({
|
|
241
|
+
oprs: z.record(z.string(), z.number()),
|
|
242
|
+
dprs: z.record(z.string(), z.number()),
|
|
243
|
+
ccwms: z.record(z.string(), z.number()),
|
|
244
|
+
});
|
|
245
|
+
export const TeamEventStatusSchema = z.object({
|
|
246
|
+
qual: z
|
|
247
|
+
.object({
|
|
248
|
+
num_teams: z.number().nullish(),
|
|
249
|
+
ranking: z
|
|
250
|
+
.object({
|
|
251
|
+
dq: z.number().nullish(),
|
|
252
|
+
matches_played: z.number(),
|
|
253
|
+
qual_average: z.number().nullish(),
|
|
254
|
+
rank: z.number(),
|
|
255
|
+
record: z
|
|
256
|
+
.object({
|
|
257
|
+
losses: z.number(),
|
|
258
|
+
ties: z.number(),
|
|
259
|
+
wins: z.number(),
|
|
260
|
+
})
|
|
261
|
+
.nullish(),
|
|
262
|
+
sort_orders: z.array(z.number()).nullish(),
|
|
263
|
+
team_key: z.string(),
|
|
264
|
+
})
|
|
265
|
+
.nullish(),
|
|
266
|
+
sort_order_info: z
|
|
267
|
+
.array(z.object({
|
|
268
|
+
name: z.string(),
|
|
269
|
+
precision: z.number(),
|
|
270
|
+
}))
|
|
271
|
+
.nullish(),
|
|
272
|
+
status: z.string().nullish(),
|
|
273
|
+
})
|
|
274
|
+
.nullish(),
|
|
275
|
+
alliance: z
|
|
276
|
+
.object({
|
|
277
|
+
backup: z
|
|
278
|
+
.object({
|
|
279
|
+
in: z.string().nullish(),
|
|
280
|
+
out: z.string().nullish(),
|
|
281
|
+
})
|
|
282
|
+
.nullish(),
|
|
283
|
+
name: z.string().nullish(),
|
|
284
|
+
number: z.number().nullish(),
|
|
285
|
+
pick: z.number().nullish(),
|
|
286
|
+
})
|
|
287
|
+
.nullish(),
|
|
288
|
+
playoff: z
|
|
289
|
+
.object({
|
|
290
|
+
current_level_record: z
|
|
291
|
+
.object({
|
|
292
|
+
losses: z.number(),
|
|
293
|
+
ties: z.number(),
|
|
294
|
+
wins: z.number(),
|
|
295
|
+
})
|
|
296
|
+
.nullish(),
|
|
297
|
+
level: z.string().nullish(),
|
|
298
|
+
playoff_average: z.number().nullish(),
|
|
299
|
+
record: z
|
|
300
|
+
.object({
|
|
301
|
+
losses: z.number(),
|
|
302
|
+
ties: z.number(),
|
|
303
|
+
wins: z.number(),
|
|
304
|
+
})
|
|
305
|
+
.nullish(),
|
|
306
|
+
status: z.string().nullish(),
|
|
307
|
+
})
|
|
308
|
+
.nullish(),
|
|
309
|
+
alliance_status_str: z.string(),
|
|
310
|
+
playoff_status_str: z.string(),
|
|
311
|
+
overall_status_str: z.string(),
|
|
312
|
+
next_match_key: z.string().nullish(),
|
|
313
|
+
last_match_key: z.string().nullish(),
|
|
314
|
+
});
|
|
315
|
+
export const DistrictRankingSchema = z.object({
|
|
316
|
+
team_key: z.string(),
|
|
317
|
+
rank: z.number(),
|
|
318
|
+
rookie_bonus: z.number().nullish(),
|
|
319
|
+
point_total: z.number(),
|
|
320
|
+
event_points: z.array(z.object({
|
|
321
|
+
district_cmp: z.boolean(),
|
|
322
|
+
total: z.number(),
|
|
323
|
+
alliance_points: z.number(),
|
|
324
|
+
elim_points: z.number(),
|
|
325
|
+
award_points: z.number(),
|
|
326
|
+
event_key: z.string(),
|
|
327
|
+
qual_points: z.number(),
|
|
328
|
+
})),
|
|
329
|
+
});
|
|
330
|
+
export const TeamSimpleSchema = z.object({
|
|
331
|
+
key: z.string(),
|
|
332
|
+
team_number: z.number(),
|
|
333
|
+
nickname: z.string().nullish(),
|
|
334
|
+
name: z.string(),
|
|
335
|
+
city: z.string().nullish(),
|
|
336
|
+
state_prov: z.string().nullish(),
|
|
337
|
+
country: z.string().nullish(),
|
|
338
|
+
});
|
|
339
|
+
export const EventSimpleSchema = z.object({
|
|
340
|
+
key: z.string(),
|
|
341
|
+
name: z.string(),
|
|
342
|
+
event_code: z.string(),
|
|
343
|
+
event_type: z.number(),
|
|
344
|
+
city: z.string().nullish(),
|
|
345
|
+
state_prov: z.string().nullish(),
|
|
346
|
+
country: z.string().nullish(),
|
|
347
|
+
start_date: z.string(),
|
|
348
|
+
end_date: z.string(),
|
|
349
|
+
year: z.number(),
|
|
350
|
+
});
|
|
351
|
+
export const MatchSimpleSchema = z.object({
|
|
352
|
+
key: z.string(),
|
|
353
|
+
comp_level: z.string(),
|
|
354
|
+
set_number: z.number(),
|
|
355
|
+
match_number: z.number(),
|
|
356
|
+
alliances: z.object({
|
|
357
|
+
red: z.object({
|
|
358
|
+
score: z.number(),
|
|
359
|
+
team_keys: z.array(z.string()),
|
|
360
|
+
}),
|
|
361
|
+
blue: z.object({
|
|
362
|
+
score: z.number(),
|
|
363
|
+
team_keys: z.array(z.string()),
|
|
364
|
+
}),
|
|
365
|
+
}),
|
|
366
|
+
winning_alliance: z.string().nullish(),
|
|
367
|
+
event_key: z.string(),
|
|
368
|
+
time: z.number().nullish(),
|
|
369
|
+
predicted_time: z.number().nullish(),
|
|
370
|
+
actual_time: z.number().nullish(),
|
|
371
|
+
});
|
|
372
|
+
export const ZebraSchema = z.object({
|
|
373
|
+
key: z.string(),
|
|
374
|
+
times: z.array(z.number()),
|
|
375
|
+
alliances: z.object({
|
|
376
|
+
red: z.array(z.object({
|
|
377
|
+
team_key: z.string(),
|
|
378
|
+
xs: z.array(z.number()).nullish(),
|
|
379
|
+
ys: z.array(z.number()).nullish(),
|
|
380
|
+
})),
|
|
381
|
+
blue: z.array(z.object({
|
|
382
|
+
team_key: z.string(),
|
|
383
|
+
xs: z.array(z.number()).nullish(),
|
|
384
|
+
ys: z.array(z.number()).nullish(),
|
|
385
|
+
})),
|
|
386
|
+
}),
|
|
387
|
+
});
|
|
388
|
+
export const PredictionSchema = z.object({
|
|
389
|
+
match_predictions: z
|
|
390
|
+
.record(z.string(), z.object({
|
|
391
|
+
red: z
|
|
392
|
+
.object({
|
|
393
|
+
score: z.number(),
|
|
394
|
+
})
|
|
395
|
+
.optional(),
|
|
396
|
+
blue: z
|
|
397
|
+
.object({
|
|
398
|
+
score: z.number(),
|
|
399
|
+
})
|
|
400
|
+
.optional(),
|
|
401
|
+
}))
|
|
402
|
+
.or(z.any())
|
|
403
|
+
.nullish(),
|
|
404
|
+
ranking_predictions: z
|
|
405
|
+
.record(z.string(), z.object({
|
|
406
|
+
rank: z.number(),
|
|
407
|
+
}))
|
|
408
|
+
.or(z.array(z.any()))
|
|
409
|
+
.nullish(),
|
|
410
|
+
stat_mean_vars: z.record(z.string(), z.any()).nullish(),
|
|
411
|
+
});
|
|
412
|
+
export const TeamHistorySchema = z.object({
|
|
413
|
+
awards: z.array(AwardSchema).nullish(),
|
|
414
|
+
events: z.array(EventSchema).nullish(),
|
|
415
|
+
matches: z.array(MatchSchema).nullish(),
|
|
416
|
+
robots: z.array(RobotSchema).nullish(),
|
|
417
|
+
});
|
|
418
|
+
let API_KEY;
|
|
419
|
+
function getApiKey() {
|
|
420
|
+
if (!API_KEY) {
|
|
421
|
+
API_KEY = process.env['TBA_API_KEY'];
|
|
422
|
+
if (!API_KEY) {
|
|
423
|
+
throw new Error('TBA_API_KEY environment variable is required');
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
return API_KEY;
|
|
427
|
+
}
|
|
428
|
+
export async function makeApiRequest(endpoint) {
|
|
429
|
+
const apiKey = getApiKey();
|
|
430
|
+
const url = `https://www.thebluealliance.com/api/v3${endpoint}`;
|
|
431
|
+
const response = await fetch(url, {
|
|
432
|
+
headers: {
|
|
433
|
+
'X-TBA-Auth-Key': apiKey,
|
|
434
|
+
Accept: 'application/json',
|
|
435
|
+
},
|
|
436
|
+
});
|
|
437
|
+
if (!response.ok) {
|
|
438
|
+
throw new Error(`TBA API request failed: ${response.status} ${response.statusText}`);
|
|
439
|
+
}
|
|
440
|
+
return response.json();
|
|
441
|
+
}
|
|
442
|
+
async function runServer() {
|
|
443
|
+
console.error('The Blue Alliance MCP Server starting ...');
|
|
444
|
+
const server = new Server({
|
|
445
|
+
name: 'The Blue Alliance MCP Server',
|
|
446
|
+
version: '0.2.1',
|
|
447
|
+
}, {
|
|
448
|
+
capabilities: {
|
|
449
|
+
tools: {},
|
|
450
|
+
},
|
|
451
|
+
});
|
|
452
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
453
|
+
return {
|
|
454
|
+
tools: [
|
|
455
|
+
{
|
|
456
|
+
name: 'get_team',
|
|
457
|
+
description: 'Get detailed information about a specific FRC team',
|
|
458
|
+
inputSchema: {
|
|
459
|
+
type: 'object',
|
|
460
|
+
properties: {
|
|
461
|
+
team_key: {
|
|
462
|
+
type: 'string',
|
|
463
|
+
description: 'Team key in format frcXXXX (e.g., frc86)',
|
|
464
|
+
pattern: '^frc\\d+$',
|
|
465
|
+
},
|
|
466
|
+
},
|
|
467
|
+
required: ['team_key'],
|
|
468
|
+
},
|
|
469
|
+
},
|
|
470
|
+
{
|
|
471
|
+
name: 'get_team_events',
|
|
472
|
+
description: 'Get events that a team has participated in for a given year',
|
|
473
|
+
inputSchema: {
|
|
474
|
+
type: 'object',
|
|
475
|
+
properties: {
|
|
476
|
+
team_key: {
|
|
477
|
+
type: 'string',
|
|
478
|
+
description: 'Team key in format frcXXXX (e.g., frc86)',
|
|
479
|
+
pattern: '^frc\\d+$',
|
|
480
|
+
},
|
|
481
|
+
year: {
|
|
482
|
+
type: 'number',
|
|
483
|
+
description: 'Competition year',
|
|
484
|
+
minimum: 1992,
|
|
485
|
+
maximum: new Date().getFullYear() + 1,
|
|
486
|
+
},
|
|
487
|
+
},
|
|
488
|
+
required: ['team_key', 'year'],
|
|
489
|
+
},
|
|
490
|
+
},
|
|
491
|
+
{
|
|
492
|
+
name: 'get_team_awards',
|
|
493
|
+
description: 'Get awards won by a team in a specific year',
|
|
494
|
+
inputSchema: {
|
|
495
|
+
type: 'object',
|
|
496
|
+
properties: {
|
|
497
|
+
team_key: {
|
|
498
|
+
type: 'string',
|
|
499
|
+
description: 'Team key in format frcXXXX (e.g., frc86)',
|
|
500
|
+
pattern: '^frc\\d+$',
|
|
501
|
+
},
|
|
502
|
+
year: {
|
|
503
|
+
type: 'number',
|
|
504
|
+
description: 'Competition year',
|
|
505
|
+
minimum: 1992,
|
|
506
|
+
maximum: new Date().getFullYear() + 1,
|
|
507
|
+
},
|
|
508
|
+
},
|
|
509
|
+
required: ['team_key', 'year'],
|
|
510
|
+
},
|
|
511
|
+
},
|
|
512
|
+
{
|
|
513
|
+
name: 'get_team_matches',
|
|
514
|
+
description: 'Get matches played by a team in a specific year',
|
|
515
|
+
inputSchema: {
|
|
516
|
+
type: 'object',
|
|
517
|
+
properties: {
|
|
518
|
+
team_key: {
|
|
519
|
+
type: 'string',
|
|
520
|
+
description: 'Team key in format frcXXXX (e.g., frc86)',
|
|
521
|
+
pattern: '^frc\\d+$',
|
|
522
|
+
},
|
|
523
|
+
year: {
|
|
524
|
+
type: 'number',
|
|
525
|
+
description: 'Competition year',
|
|
526
|
+
minimum: 1992,
|
|
527
|
+
maximum: new Date().getFullYear() + 1,
|
|
528
|
+
},
|
|
529
|
+
},
|
|
530
|
+
required: ['team_key', 'year'],
|
|
531
|
+
},
|
|
532
|
+
},
|
|
533
|
+
{
|
|
534
|
+
name: 'get_events',
|
|
535
|
+
description: 'Get all FRC events for a specific year',
|
|
536
|
+
inputSchema: {
|
|
537
|
+
type: 'object',
|
|
538
|
+
properties: {
|
|
539
|
+
year: {
|
|
540
|
+
type: 'number',
|
|
541
|
+
description: 'Competition year',
|
|
542
|
+
minimum: 1992,
|
|
543
|
+
maximum: new Date().getFullYear() + 1,
|
|
544
|
+
},
|
|
545
|
+
},
|
|
546
|
+
required: ['year'],
|
|
547
|
+
},
|
|
548
|
+
},
|
|
549
|
+
{
|
|
550
|
+
name: 'get_event',
|
|
551
|
+
description: 'Get detailed information about a specific event',
|
|
552
|
+
inputSchema: {
|
|
553
|
+
type: 'object',
|
|
554
|
+
properties: {
|
|
555
|
+
event_key: {
|
|
556
|
+
type: 'string',
|
|
557
|
+
description: 'Event key (e.g., 2023casj)',
|
|
558
|
+
},
|
|
559
|
+
},
|
|
560
|
+
required: ['event_key'],
|
|
561
|
+
},
|
|
562
|
+
},
|
|
563
|
+
{
|
|
564
|
+
name: 'get_event_teams',
|
|
565
|
+
description: 'Get teams participating in a specific event',
|
|
566
|
+
inputSchema: {
|
|
567
|
+
type: 'object',
|
|
568
|
+
properties: {
|
|
569
|
+
event_key: {
|
|
570
|
+
type: 'string',
|
|
571
|
+
description: 'Event key (e.g., 2023casj)',
|
|
572
|
+
},
|
|
573
|
+
},
|
|
574
|
+
required: ['event_key'],
|
|
575
|
+
},
|
|
576
|
+
},
|
|
577
|
+
{
|
|
578
|
+
name: 'get_event_rankings',
|
|
579
|
+
description: 'Get team rankings for a specific event',
|
|
580
|
+
inputSchema: {
|
|
581
|
+
type: 'object',
|
|
582
|
+
properties: {
|
|
583
|
+
event_key: {
|
|
584
|
+
type: 'string',
|
|
585
|
+
description: 'Event key (e.g., 2023casj)',
|
|
586
|
+
},
|
|
587
|
+
},
|
|
588
|
+
required: ['event_key'],
|
|
589
|
+
},
|
|
590
|
+
},
|
|
591
|
+
{
|
|
592
|
+
name: 'get_event_matches',
|
|
593
|
+
description: 'Get matches for a specific event',
|
|
594
|
+
inputSchema: {
|
|
595
|
+
type: 'object',
|
|
596
|
+
properties: {
|
|
597
|
+
event_key: {
|
|
598
|
+
type: 'string',
|
|
599
|
+
description: 'Event key (e.g., 2023casj)',
|
|
600
|
+
},
|
|
601
|
+
},
|
|
602
|
+
required: ['event_key'],
|
|
603
|
+
},
|
|
604
|
+
},
|
|
605
|
+
{
|
|
606
|
+
name: 'get_event_alliances',
|
|
607
|
+
description: 'Get elimination alliances for a specific event',
|
|
608
|
+
inputSchema: {
|
|
609
|
+
type: 'object',
|
|
610
|
+
properties: {
|
|
611
|
+
event_key: {
|
|
612
|
+
type: 'string',
|
|
613
|
+
description: 'Event key (e.g., 2023casj)',
|
|
614
|
+
},
|
|
615
|
+
},
|
|
616
|
+
required: ['event_key'],
|
|
617
|
+
},
|
|
618
|
+
},
|
|
619
|
+
{
|
|
620
|
+
name: 'get_event_insights',
|
|
621
|
+
description: 'Get event-specific insights and statistics',
|
|
622
|
+
inputSchema: {
|
|
623
|
+
type: 'object',
|
|
624
|
+
properties: {
|
|
625
|
+
event_key: {
|
|
626
|
+
type: 'string',
|
|
627
|
+
description: 'Event key (e.g., 2023casj)',
|
|
628
|
+
},
|
|
629
|
+
},
|
|
630
|
+
required: ['event_key'],
|
|
631
|
+
},
|
|
632
|
+
},
|
|
633
|
+
{
|
|
634
|
+
name: 'get_event_district_points',
|
|
635
|
+
description: 'Get district points for teams at an event',
|
|
636
|
+
inputSchema: {
|
|
637
|
+
type: 'object',
|
|
638
|
+
properties: {
|
|
639
|
+
event_key: {
|
|
640
|
+
type: 'string',
|
|
641
|
+
description: 'Event key (e.g., 2023casj)',
|
|
642
|
+
},
|
|
643
|
+
},
|
|
644
|
+
required: ['event_key'],
|
|
645
|
+
},
|
|
646
|
+
},
|
|
647
|
+
{
|
|
648
|
+
name: 'get_team_years_participated',
|
|
649
|
+
description: 'Get years that a team has participated in competition',
|
|
650
|
+
inputSchema: {
|
|
651
|
+
type: 'object',
|
|
652
|
+
properties: {
|
|
653
|
+
team_key: {
|
|
654
|
+
type: 'string',
|
|
655
|
+
description: 'Team key in format frcXXXX (e.g., frc86)',
|
|
656
|
+
pattern: '^frc\\d+$',
|
|
657
|
+
},
|
|
658
|
+
},
|
|
659
|
+
required: ['team_key'],
|
|
660
|
+
},
|
|
661
|
+
},
|
|
662
|
+
{
|
|
663
|
+
name: 'get_team_districts',
|
|
664
|
+
description: 'Get district history for a team',
|
|
665
|
+
inputSchema: {
|
|
666
|
+
type: 'object',
|
|
667
|
+
properties: {
|
|
668
|
+
team_key: {
|
|
669
|
+
type: 'string',
|
|
670
|
+
description: 'Team key in format frcXXXX (e.g., frc86)',
|
|
671
|
+
pattern: '^frc\\d+$',
|
|
672
|
+
},
|
|
673
|
+
},
|
|
674
|
+
required: ['team_key'],
|
|
675
|
+
},
|
|
676
|
+
},
|
|
677
|
+
{
|
|
678
|
+
name: 'get_team_robots',
|
|
679
|
+
description: 'Get robot names for a team by year',
|
|
680
|
+
inputSchema: {
|
|
681
|
+
type: 'object',
|
|
682
|
+
properties: {
|
|
683
|
+
team_key: {
|
|
684
|
+
type: 'string',
|
|
685
|
+
description: 'Team key in format frcXXXX (e.g., frc86)',
|
|
686
|
+
pattern: '^frc\\d+$',
|
|
687
|
+
},
|
|
688
|
+
},
|
|
689
|
+
required: ['team_key'],
|
|
690
|
+
},
|
|
691
|
+
},
|
|
692
|
+
{
|
|
693
|
+
name: 'get_team_media',
|
|
694
|
+
description: 'Get media for a team in a specific year',
|
|
695
|
+
inputSchema: {
|
|
696
|
+
type: 'object',
|
|
697
|
+
properties: {
|
|
698
|
+
team_key: {
|
|
699
|
+
type: 'string',
|
|
700
|
+
description: 'Team key in format frcXXXX (e.g., frc86)',
|
|
701
|
+
pattern: '^frc\\d+$',
|
|
702
|
+
},
|
|
703
|
+
year: {
|
|
704
|
+
type: 'number',
|
|
705
|
+
description: 'Competition year',
|
|
706
|
+
minimum: 1992,
|
|
707
|
+
maximum: new Date().getFullYear() + 1,
|
|
708
|
+
},
|
|
709
|
+
},
|
|
710
|
+
required: ['team_key', 'year'],
|
|
711
|
+
},
|
|
712
|
+
},
|
|
713
|
+
{
|
|
714
|
+
name: 'get_team_event_matches',
|
|
715
|
+
description: 'Get matches for a team at a specific event',
|
|
716
|
+
inputSchema: {
|
|
717
|
+
type: 'object',
|
|
718
|
+
properties: {
|
|
719
|
+
team_key: {
|
|
720
|
+
type: 'string',
|
|
721
|
+
description: 'Team key in format frcXXXX (e.g., frc86)',
|
|
722
|
+
pattern: '^frc\\d+$',
|
|
723
|
+
},
|
|
724
|
+
event_key: {
|
|
725
|
+
type: 'string',
|
|
726
|
+
description: 'Event key (e.g., 2023casj)',
|
|
727
|
+
},
|
|
728
|
+
},
|
|
729
|
+
required: ['team_key', 'event_key'],
|
|
730
|
+
},
|
|
731
|
+
},
|
|
732
|
+
{
|
|
733
|
+
name: 'get_teams',
|
|
734
|
+
description: 'Get list of teams with pagination',
|
|
735
|
+
inputSchema: {
|
|
736
|
+
type: 'object',
|
|
737
|
+
properties: {
|
|
738
|
+
page_num: {
|
|
739
|
+
type: 'number',
|
|
740
|
+
description: 'Page number (0-indexed)',
|
|
741
|
+
minimum: 0,
|
|
742
|
+
},
|
|
743
|
+
},
|
|
744
|
+
required: ['page_num'],
|
|
745
|
+
},
|
|
746
|
+
},
|
|
747
|
+
{
|
|
748
|
+
name: 'get_status',
|
|
749
|
+
description: 'Get TBA API status information',
|
|
750
|
+
inputSchema: {
|
|
751
|
+
type: 'object',
|
|
752
|
+
properties: {},
|
|
753
|
+
},
|
|
754
|
+
},
|
|
755
|
+
{
|
|
756
|
+
name: 'get_match',
|
|
757
|
+
description: 'Get detailed information about a specific match',
|
|
758
|
+
inputSchema: {
|
|
759
|
+
type: 'object',
|
|
760
|
+
properties: {
|
|
761
|
+
match_key: {
|
|
762
|
+
type: 'string',
|
|
763
|
+
description: 'Match key (e.g., 2023casj_qm1)',
|
|
764
|
+
},
|
|
765
|
+
},
|
|
766
|
+
required: ['match_key'],
|
|
767
|
+
},
|
|
768
|
+
},
|
|
769
|
+
{
|
|
770
|
+
name: 'get_event_oprs',
|
|
771
|
+
description: 'Get OPR, DPR, and CCWM ratings for teams at an event',
|
|
772
|
+
inputSchema: {
|
|
773
|
+
type: 'object',
|
|
774
|
+
properties: {
|
|
775
|
+
event_key: {
|
|
776
|
+
type: 'string',
|
|
777
|
+
description: 'Event key (e.g., 2023casj)',
|
|
778
|
+
},
|
|
779
|
+
},
|
|
780
|
+
required: ['event_key'],
|
|
781
|
+
},
|
|
782
|
+
},
|
|
783
|
+
{
|
|
784
|
+
name: 'get_event_awards',
|
|
785
|
+
description: 'Get awards from a specific event',
|
|
786
|
+
inputSchema: {
|
|
787
|
+
type: 'object',
|
|
788
|
+
properties: {
|
|
789
|
+
event_key: {
|
|
790
|
+
type: 'string',
|
|
791
|
+
description: 'Event key (e.g., 2023casj)',
|
|
792
|
+
},
|
|
793
|
+
},
|
|
794
|
+
required: ['event_key'],
|
|
795
|
+
},
|
|
796
|
+
},
|
|
797
|
+
{
|
|
798
|
+
name: 'get_team_awards_all',
|
|
799
|
+
description: 'Get all awards won by a team across all years',
|
|
800
|
+
inputSchema: {
|
|
801
|
+
type: 'object',
|
|
802
|
+
properties: {
|
|
803
|
+
team_key: {
|
|
804
|
+
type: 'string',
|
|
805
|
+
description: 'Team key in format frcXXXX (e.g., frc86)',
|
|
806
|
+
pattern: '^frc\\d+$',
|
|
807
|
+
},
|
|
808
|
+
},
|
|
809
|
+
required: ['team_key'],
|
|
810
|
+
},
|
|
811
|
+
},
|
|
812
|
+
{
|
|
813
|
+
name: 'get_team_events_all',
|
|
814
|
+
description: 'Get all events a team has participated in across all years',
|
|
815
|
+
inputSchema: {
|
|
816
|
+
type: 'object',
|
|
817
|
+
properties: {
|
|
818
|
+
team_key: {
|
|
819
|
+
type: 'string',
|
|
820
|
+
description: 'Team key in format frcXXXX (e.g., frc86)',
|
|
821
|
+
pattern: '^frc\\d+$',
|
|
822
|
+
},
|
|
823
|
+
},
|
|
824
|
+
required: ['team_key'],
|
|
825
|
+
},
|
|
826
|
+
},
|
|
827
|
+
{
|
|
828
|
+
name: 'get_team_event_status',
|
|
829
|
+
description: 'Get team competition rank and status at a specific event',
|
|
830
|
+
inputSchema: {
|
|
831
|
+
type: 'object',
|
|
832
|
+
properties: {
|
|
833
|
+
team_key: {
|
|
834
|
+
type: 'string',
|
|
835
|
+
description: 'Team key in format frcXXXX (e.g., frc86)',
|
|
836
|
+
pattern: '^frc\\d+$',
|
|
837
|
+
},
|
|
838
|
+
event_key: {
|
|
839
|
+
type: 'string',
|
|
840
|
+
description: 'Event key (e.g., 2023casj)',
|
|
841
|
+
},
|
|
842
|
+
},
|
|
843
|
+
required: ['team_key', 'event_key'],
|
|
844
|
+
},
|
|
845
|
+
},
|
|
846
|
+
{
|
|
847
|
+
name: 'get_districts',
|
|
848
|
+
description: 'Get all districts for a specific year',
|
|
849
|
+
inputSchema: {
|
|
850
|
+
type: 'object',
|
|
851
|
+
properties: {
|
|
852
|
+
year: {
|
|
853
|
+
type: 'number',
|
|
854
|
+
description: 'Competition year',
|
|
855
|
+
minimum: 1992,
|
|
856
|
+
maximum: new Date().getFullYear() + 1,
|
|
857
|
+
},
|
|
858
|
+
},
|
|
859
|
+
required: ['year'],
|
|
860
|
+
},
|
|
861
|
+
},
|
|
862
|
+
{
|
|
863
|
+
name: 'get_district_rankings',
|
|
864
|
+
description: 'Get team rankings within a district',
|
|
865
|
+
inputSchema: {
|
|
866
|
+
type: 'object',
|
|
867
|
+
properties: {
|
|
868
|
+
district_key: {
|
|
869
|
+
type: 'string',
|
|
870
|
+
description: 'District key (e.g., 2023fim)',
|
|
871
|
+
},
|
|
872
|
+
},
|
|
873
|
+
required: ['district_key'],
|
|
874
|
+
},
|
|
875
|
+
},
|
|
876
|
+
{
|
|
877
|
+
name: 'get_teams_simple',
|
|
878
|
+
description: 'Get simplified list of teams with pagination',
|
|
879
|
+
inputSchema: {
|
|
880
|
+
type: 'object',
|
|
881
|
+
properties: {
|
|
882
|
+
page_num: {
|
|
883
|
+
type: 'number',
|
|
884
|
+
description: 'Page number (0-indexed)',
|
|
885
|
+
minimum: 0,
|
|
886
|
+
},
|
|
887
|
+
},
|
|
888
|
+
required: ['page_num'],
|
|
889
|
+
},
|
|
890
|
+
},
|
|
891
|
+
{
|
|
892
|
+
name: 'get_teams_keys',
|
|
893
|
+
description: 'Get list of team keys with pagination',
|
|
894
|
+
inputSchema: {
|
|
895
|
+
type: 'object',
|
|
896
|
+
properties: {
|
|
897
|
+
page_num: {
|
|
898
|
+
type: 'number',
|
|
899
|
+
description: 'Page number (0-indexed)',
|
|
900
|
+
minimum: 0,
|
|
901
|
+
},
|
|
902
|
+
},
|
|
903
|
+
required: ['page_num'],
|
|
904
|
+
},
|
|
905
|
+
},
|
|
906
|
+
{
|
|
907
|
+
name: 'get_teams_by_year',
|
|
908
|
+
description: 'Get teams that competed in a specific year',
|
|
909
|
+
inputSchema: {
|
|
910
|
+
type: 'object',
|
|
911
|
+
properties: {
|
|
912
|
+
year: {
|
|
913
|
+
type: 'number',
|
|
914
|
+
description: 'Competition year',
|
|
915
|
+
minimum: 1992,
|
|
916
|
+
maximum: new Date().getFullYear() + 1,
|
|
917
|
+
},
|
|
918
|
+
page_num: {
|
|
919
|
+
type: 'number',
|
|
920
|
+
description: 'Page number (0-indexed)',
|
|
921
|
+
minimum: 0,
|
|
922
|
+
},
|
|
923
|
+
},
|
|
924
|
+
required: ['year', 'page_num'],
|
|
925
|
+
},
|
|
926
|
+
},
|
|
927
|
+
{
|
|
928
|
+
name: 'get_teams_by_year_simple',
|
|
929
|
+
description: 'Get simplified teams that competed in a specific year',
|
|
930
|
+
inputSchema: {
|
|
931
|
+
type: 'object',
|
|
932
|
+
properties: {
|
|
933
|
+
year: {
|
|
934
|
+
type: 'number',
|
|
935
|
+
description: 'Competition year',
|
|
936
|
+
minimum: 1992,
|
|
937
|
+
maximum: new Date().getFullYear() + 1,
|
|
938
|
+
},
|
|
939
|
+
page_num: {
|
|
940
|
+
type: 'number',
|
|
941
|
+
description: 'Page number (0-indexed)',
|
|
942
|
+
minimum: 0,
|
|
943
|
+
},
|
|
944
|
+
},
|
|
945
|
+
required: ['year', 'page_num'],
|
|
946
|
+
},
|
|
947
|
+
},
|
|
948
|
+
{
|
|
949
|
+
name: 'get_teams_by_year_keys',
|
|
950
|
+
description: 'Get team keys that competed in a specific year',
|
|
951
|
+
inputSchema: {
|
|
952
|
+
type: 'object',
|
|
953
|
+
properties: {
|
|
954
|
+
year: {
|
|
955
|
+
type: 'number',
|
|
956
|
+
description: 'Competition year',
|
|
957
|
+
minimum: 1992,
|
|
958
|
+
maximum: new Date().getFullYear() + 1,
|
|
959
|
+
},
|
|
960
|
+
page_num: {
|
|
961
|
+
type: 'number',
|
|
962
|
+
description: 'Page number (0-indexed)',
|
|
963
|
+
minimum: 0,
|
|
964
|
+
},
|
|
965
|
+
},
|
|
966
|
+
required: ['year', 'page_num'],
|
|
967
|
+
},
|
|
968
|
+
},
|
|
969
|
+
{
|
|
970
|
+
name: 'get_team_simple',
|
|
971
|
+
description: 'Get simplified information about a specific team',
|
|
972
|
+
inputSchema: {
|
|
973
|
+
type: 'object',
|
|
974
|
+
properties: {
|
|
975
|
+
team_key: {
|
|
976
|
+
type: 'string',
|
|
977
|
+
description: 'Team key in format frcXXXX (e.g., frc86)',
|
|
978
|
+
pattern: '^frc\\d+$',
|
|
979
|
+
},
|
|
980
|
+
},
|
|
981
|
+
required: ['team_key'],
|
|
982
|
+
},
|
|
983
|
+
},
|
|
984
|
+
{
|
|
985
|
+
name: 'get_event_simple',
|
|
986
|
+
description: 'Get simplified information about a specific event',
|
|
987
|
+
inputSchema: {
|
|
988
|
+
type: 'object',
|
|
989
|
+
properties: {
|
|
990
|
+
event_key: {
|
|
991
|
+
type: 'string',
|
|
992
|
+
description: 'Event key (e.g., 2023casj)',
|
|
993
|
+
},
|
|
994
|
+
},
|
|
995
|
+
required: ['event_key'],
|
|
996
|
+
},
|
|
997
|
+
},
|
|
998
|
+
{
|
|
999
|
+
name: 'get_events_simple',
|
|
1000
|
+
description: 'Get simplified list of events for a year',
|
|
1001
|
+
inputSchema: {
|
|
1002
|
+
type: 'object',
|
|
1003
|
+
properties: {
|
|
1004
|
+
year: {
|
|
1005
|
+
type: 'number',
|
|
1006
|
+
description: 'Competition year',
|
|
1007
|
+
minimum: 1992,
|
|
1008
|
+
maximum: new Date().getFullYear() + 1,
|
|
1009
|
+
},
|
|
1010
|
+
},
|
|
1011
|
+
required: ['year'],
|
|
1012
|
+
},
|
|
1013
|
+
},
|
|
1014
|
+
{
|
|
1015
|
+
name: 'get_events_keys',
|
|
1016
|
+
description: 'Get list of event keys for a year',
|
|
1017
|
+
inputSchema: {
|
|
1018
|
+
type: 'object',
|
|
1019
|
+
properties: {
|
|
1020
|
+
year: {
|
|
1021
|
+
type: 'number',
|
|
1022
|
+
description: 'Competition year',
|
|
1023
|
+
minimum: 1992,
|
|
1024
|
+
maximum: new Date().getFullYear() + 1,
|
|
1025
|
+
},
|
|
1026
|
+
},
|
|
1027
|
+
required: ['year'],
|
|
1028
|
+
},
|
|
1029
|
+
},
|
|
1030
|
+
{
|
|
1031
|
+
name: 'get_match_simple',
|
|
1032
|
+
description: 'Get simplified information about a specific match',
|
|
1033
|
+
inputSchema: {
|
|
1034
|
+
type: 'object',
|
|
1035
|
+
properties: {
|
|
1036
|
+
match_key: {
|
|
1037
|
+
type: 'string',
|
|
1038
|
+
description: 'Match key (e.g., 2023casj_qm1)',
|
|
1039
|
+
},
|
|
1040
|
+
},
|
|
1041
|
+
required: ['match_key'],
|
|
1042
|
+
},
|
|
1043
|
+
},
|
|
1044
|
+
{
|
|
1045
|
+
name: 'get_team_events_simple',
|
|
1046
|
+
description: 'Get simplified events for a team in a specific year',
|
|
1047
|
+
inputSchema: {
|
|
1048
|
+
type: 'object',
|
|
1049
|
+
properties: {
|
|
1050
|
+
team_key: {
|
|
1051
|
+
type: 'string',
|
|
1052
|
+
description: 'Team key in format frcXXXX (e.g., frc86)',
|
|
1053
|
+
pattern: '^frc\\d+$',
|
|
1054
|
+
},
|
|
1055
|
+
year: {
|
|
1056
|
+
type: 'number',
|
|
1057
|
+
description: 'Competition year',
|
|
1058
|
+
minimum: 1992,
|
|
1059
|
+
maximum: new Date().getFullYear() + 1,
|
|
1060
|
+
},
|
|
1061
|
+
},
|
|
1062
|
+
required: ['team_key', 'year'],
|
|
1063
|
+
},
|
|
1064
|
+
},
|
|
1065
|
+
{
|
|
1066
|
+
name: 'get_team_events_keys',
|
|
1067
|
+
description: 'Get event keys for a team in a specific year',
|
|
1068
|
+
inputSchema: {
|
|
1069
|
+
type: 'object',
|
|
1070
|
+
properties: {
|
|
1071
|
+
team_key: {
|
|
1072
|
+
type: 'string',
|
|
1073
|
+
description: 'Team key in format frcXXXX (e.g., frc86)',
|
|
1074
|
+
pattern: '^frc\\d+$',
|
|
1075
|
+
},
|
|
1076
|
+
year: {
|
|
1077
|
+
type: 'number',
|
|
1078
|
+
description: 'Competition year',
|
|
1079
|
+
minimum: 1992,
|
|
1080
|
+
maximum: new Date().getFullYear() + 1,
|
|
1081
|
+
},
|
|
1082
|
+
},
|
|
1083
|
+
required: ['team_key', 'year'],
|
|
1084
|
+
},
|
|
1085
|
+
},
|
|
1086
|
+
{
|
|
1087
|
+
name: 'get_team_event_awards',
|
|
1088
|
+
description: 'Get awards won by a team at a specific event',
|
|
1089
|
+
inputSchema: {
|
|
1090
|
+
type: 'object',
|
|
1091
|
+
properties: {
|
|
1092
|
+
team_key: {
|
|
1093
|
+
type: 'string',
|
|
1094
|
+
description: 'Team key in format frcXXXX (e.g., frc86)',
|
|
1095
|
+
pattern: '^frc\\d+$',
|
|
1096
|
+
},
|
|
1097
|
+
event_key: {
|
|
1098
|
+
type: 'string',
|
|
1099
|
+
description: 'Event key (e.g., 2023casj)',
|
|
1100
|
+
},
|
|
1101
|
+
},
|
|
1102
|
+
required: ['team_key', 'event_key'],
|
|
1103
|
+
},
|
|
1104
|
+
},
|
|
1105
|
+
{
|
|
1106
|
+
name: 'get_team_matches_simple',
|
|
1107
|
+
description: 'Get simplified matches for a team in a specific year',
|
|
1108
|
+
inputSchema: {
|
|
1109
|
+
type: 'object',
|
|
1110
|
+
properties: {
|
|
1111
|
+
team_key: {
|
|
1112
|
+
type: 'string',
|
|
1113
|
+
description: 'Team key in format frcXXXX (e.g., frc86)',
|
|
1114
|
+
pattern: '^frc\\d+$',
|
|
1115
|
+
},
|
|
1116
|
+
year: {
|
|
1117
|
+
type: 'number',
|
|
1118
|
+
description: 'Competition year',
|
|
1119
|
+
minimum: 1992,
|
|
1120
|
+
maximum: new Date().getFullYear() + 1,
|
|
1121
|
+
},
|
|
1122
|
+
},
|
|
1123
|
+
required: ['team_key', 'year'],
|
|
1124
|
+
},
|
|
1125
|
+
},
|
|
1126
|
+
{
|
|
1127
|
+
name: 'get_team_matches_keys',
|
|
1128
|
+
description: 'Get match keys for a team in a specific year',
|
|
1129
|
+
inputSchema: {
|
|
1130
|
+
type: 'object',
|
|
1131
|
+
properties: {
|
|
1132
|
+
team_key: {
|
|
1133
|
+
type: 'string',
|
|
1134
|
+
description: 'Team key in format frcXXXX (e.g., frc86)',
|
|
1135
|
+
pattern: '^frc\\d+$',
|
|
1136
|
+
},
|
|
1137
|
+
year: {
|
|
1138
|
+
type: 'number',
|
|
1139
|
+
description: 'Competition year',
|
|
1140
|
+
minimum: 1992,
|
|
1141
|
+
maximum: new Date().getFullYear() + 1,
|
|
1142
|
+
},
|
|
1143
|
+
},
|
|
1144
|
+
required: ['team_key', 'year'],
|
|
1145
|
+
},
|
|
1146
|
+
},
|
|
1147
|
+
{
|
|
1148
|
+
name: 'get_team_social_media',
|
|
1149
|
+
description: 'Get social media information for a team',
|
|
1150
|
+
inputSchema: {
|
|
1151
|
+
type: 'object',
|
|
1152
|
+
properties: {
|
|
1153
|
+
team_key: {
|
|
1154
|
+
type: 'string',
|
|
1155
|
+
description: 'Team key in format frcXXXX (e.g., frc86)',
|
|
1156
|
+
pattern: '^frc\\d+$',
|
|
1157
|
+
},
|
|
1158
|
+
},
|
|
1159
|
+
required: ['team_key'],
|
|
1160
|
+
},
|
|
1161
|
+
},
|
|
1162
|
+
{
|
|
1163
|
+
name: 'get_team_media_by_tag',
|
|
1164
|
+
description: 'Get media for a team filtered by tag',
|
|
1165
|
+
inputSchema: {
|
|
1166
|
+
type: 'object',
|
|
1167
|
+
properties: {
|
|
1168
|
+
team_key: {
|
|
1169
|
+
type: 'string',
|
|
1170
|
+
description: 'Team key in format frcXXXX (e.g., frc86)',
|
|
1171
|
+
pattern: '^frc\\d+$',
|
|
1172
|
+
},
|
|
1173
|
+
media_tag: {
|
|
1174
|
+
type: 'string',
|
|
1175
|
+
description: 'Media tag to filter by',
|
|
1176
|
+
},
|
|
1177
|
+
},
|
|
1178
|
+
required: ['team_key', 'media_tag'],
|
|
1179
|
+
},
|
|
1180
|
+
},
|
|
1181
|
+
{
|
|
1182
|
+
name: 'get_team_media_by_tag_year',
|
|
1183
|
+
description: 'Get media for a team filtered by tag and year',
|
|
1184
|
+
inputSchema: {
|
|
1185
|
+
type: 'object',
|
|
1186
|
+
properties: {
|
|
1187
|
+
team_key: {
|
|
1188
|
+
type: 'string',
|
|
1189
|
+
description: 'Team key in format frcXXXX (e.g., frc86)',
|
|
1190
|
+
pattern: '^frc\\d+$',
|
|
1191
|
+
},
|
|
1192
|
+
media_tag: {
|
|
1193
|
+
type: 'string',
|
|
1194
|
+
description: 'Media tag to filter by',
|
|
1195
|
+
},
|
|
1196
|
+
year: {
|
|
1197
|
+
type: 'number',
|
|
1198
|
+
description: 'Competition year',
|
|
1199
|
+
minimum: 1992,
|
|
1200
|
+
maximum: new Date().getFullYear() + 1,
|
|
1201
|
+
},
|
|
1202
|
+
},
|
|
1203
|
+
required: ['team_key', 'media_tag', 'year'],
|
|
1204
|
+
},
|
|
1205
|
+
},
|
|
1206
|
+
{
|
|
1207
|
+
name: 'get_event_teams_simple',
|
|
1208
|
+
description: 'Get simplified teams participating in an event',
|
|
1209
|
+
inputSchema: {
|
|
1210
|
+
type: 'object',
|
|
1211
|
+
properties: {
|
|
1212
|
+
event_key: {
|
|
1213
|
+
type: 'string',
|
|
1214
|
+
description: 'Event key (e.g., 2023casj)',
|
|
1215
|
+
},
|
|
1216
|
+
},
|
|
1217
|
+
required: ['event_key'],
|
|
1218
|
+
},
|
|
1219
|
+
},
|
|
1220
|
+
{
|
|
1221
|
+
name: 'get_event_teams_keys',
|
|
1222
|
+
description: 'Get team keys participating in an event',
|
|
1223
|
+
inputSchema: {
|
|
1224
|
+
type: 'object',
|
|
1225
|
+
properties: {
|
|
1226
|
+
event_key: {
|
|
1227
|
+
type: 'string',
|
|
1228
|
+
description: 'Event key (e.g., 2023casj)',
|
|
1229
|
+
},
|
|
1230
|
+
},
|
|
1231
|
+
required: ['event_key'],
|
|
1232
|
+
},
|
|
1233
|
+
},
|
|
1234
|
+
{
|
|
1235
|
+
name: 'get_event_matches_simple',
|
|
1236
|
+
description: 'Get simplified matches for an event',
|
|
1237
|
+
inputSchema: {
|
|
1238
|
+
type: 'object',
|
|
1239
|
+
properties: {
|
|
1240
|
+
event_key: {
|
|
1241
|
+
type: 'string',
|
|
1242
|
+
description: 'Event key (e.g., 2023casj)',
|
|
1243
|
+
},
|
|
1244
|
+
},
|
|
1245
|
+
required: ['event_key'],
|
|
1246
|
+
},
|
|
1247
|
+
},
|
|
1248
|
+
{
|
|
1249
|
+
name: 'get_event_matches_keys',
|
|
1250
|
+
description: 'Get match keys for an event',
|
|
1251
|
+
inputSchema: {
|
|
1252
|
+
type: 'object',
|
|
1253
|
+
properties: {
|
|
1254
|
+
event_key: {
|
|
1255
|
+
type: 'string',
|
|
1256
|
+
description: 'Event key (e.g., 2023casj)',
|
|
1257
|
+
},
|
|
1258
|
+
},
|
|
1259
|
+
required: ['event_key'],
|
|
1260
|
+
},
|
|
1261
|
+
},
|
|
1262
|
+
{
|
|
1263
|
+
name: 'get_event_predictions',
|
|
1264
|
+
description: 'Get TBA-generated predictions for an event',
|
|
1265
|
+
inputSchema: {
|
|
1266
|
+
type: 'object',
|
|
1267
|
+
properties: {
|
|
1268
|
+
event_key: {
|
|
1269
|
+
type: 'string',
|
|
1270
|
+
description: 'Event key (e.g., 2023casj)',
|
|
1271
|
+
},
|
|
1272
|
+
},
|
|
1273
|
+
required: ['event_key'],
|
|
1274
|
+
},
|
|
1275
|
+
},
|
|
1276
|
+
{
|
|
1277
|
+
name: 'get_match_zebra',
|
|
1278
|
+
description: 'Get Zebra MotionWorks data for a match',
|
|
1279
|
+
inputSchema: {
|
|
1280
|
+
type: 'object',
|
|
1281
|
+
properties: {
|
|
1282
|
+
match_key: {
|
|
1283
|
+
type: 'string',
|
|
1284
|
+
description: 'Match key (e.g., 2023casj_qm1)',
|
|
1285
|
+
},
|
|
1286
|
+
},
|
|
1287
|
+
required: ['match_key'],
|
|
1288
|
+
},
|
|
1289
|
+
},
|
|
1290
|
+
{
|
|
1291
|
+
name: 'get_team_history',
|
|
1292
|
+
description: 'Get historical data for a team across all years',
|
|
1293
|
+
inputSchema: {
|
|
1294
|
+
type: 'object',
|
|
1295
|
+
properties: {
|
|
1296
|
+
team_key: {
|
|
1297
|
+
type: 'string',
|
|
1298
|
+
description: 'Team key in format frcXXXX (e.g., frc86)',
|
|
1299
|
+
pattern: '^frc\\d+$',
|
|
1300
|
+
},
|
|
1301
|
+
},
|
|
1302
|
+
required: ['team_key'],
|
|
1303
|
+
},
|
|
1304
|
+
},
|
|
1305
|
+
{
|
|
1306
|
+
name: 'get_team_event_statuses',
|
|
1307
|
+
description: 'Get team event statuses for all events in a year',
|
|
1308
|
+
inputSchema: {
|
|
1309
|
+
type: 'object',
|
|
1310
|
+
properties: {
|
|
1311
|
+
team_key: {
|
|
1312
|
+
type: 'string',
|
|
1313
|
+
description: 'Team key in format frcXXXX (e.g., frc86)',
|
|
1314
|
+
pattern: '^frc\\d+$',
|
|
1315
|
+
},
|
|
1316
|
+
year: {
|
|
1317
|
+
type: 'number',
|
|
1318
|
+
description: 'Competition year',
|
|
1319
|
+
minimum: 1992,
|
|
1320
|
+
maximum: new Date().getFullYear() + 1,
|
|
1321
|
+
},
|
|
1322
|
+
},
|
|
1323
|
+
required: ['team_key', 'year'],
|
|
1324
|
+
},
|
|
1325
|
+
},
|
|
1326
|
+
{
|
|
1327
|
+
name: 'get_team_event_matches_simple',
|
|
1328
|
+
description: 'Get simplified matches for a team at a specific event',
|
|
1329
|
+
inputSchema: {
|
|
1330
|
+
type: 'object',
|
|
1331
|
+
properties: {
|
|
1332
|
+
team_key: {
|
|
1333
|
+
type: 'string',
|
|
1334
|
+
description: 'Team key in format frcXXXX (e.g., frc86)',
|
|
1335
|
+
pattern: '^frc\\d+$',
|
|
1336
|
+
},
|
|
1337
|
+
event_key: {
|
|
1338
|
+
type: 'string',
|
|
1339
|
+
description: 'Event key (e.g., 2023casj)',
|
|
1340
|
+
},
|
|
1341
|
+
},
|
|
1342
|
+
required: ['team_key', 'event_key'],
|
|
1343
|
+
},
|
|
1344
|
+
},
|
|
1345
|
+
{
|
|
1346
|
+
name: 'get_team_event_matches_keys',
|
|
1347
|
+
description: 'Get match keys for a team at a specific event',
|
|
1348
|
+
inputSchema: {
|
|
1349
|
+
type: 'object',
|
|
1350
|
+
properties: {
|
|
1351
|
+
team_key: {
|
|
1352
|
+
type: 'string',
|
|
1353
|
+
description: 'Team key in format frcXXXX (e.g., frc86)',
|
|
1354
|
+
pattern: '^frc\\d+$',
|
|
1355
|
+
},
|
|
1356
|
+
event_key: {
|
|
1357
|
+
type: 'string',
|
|
1358
|
+
description: 'Event key (e.g., 2023casj)',
|
|
1359
|
+
},
|
|
1360
|
+
},
|
|
1361
|
+
required: ['team_key', 'event_key'],
|
|
1362
|
+
},
|
|
1363
|
+
},
|
|
1364
|
+
{
|
|
1365
|
+
name: 'get_district_events',
|
|
1366
|
+
description: 'Get events in a specific district',
|
|
1367
|
+
inputSchema: {
|
|
1368
|
+
type: 'object',
|
|
1369
|
+
properties: {
|
|
1370
|
+
district_key: {
|
|
1371
|
+
type: 'string',
|
|
1372
|
+
description: 'District key (e.g., 2023fim)',
|
|
1373
|
+
},
|
|
1374
|
+
},
|
|
1375
|
+
required: ['district_key'],
|
|
1376
|
+
},
|
|
1377
|
+
},
|
|
1378
|
+
{
|
|
1379
|
+
name: 'get_district_events_simple',
|
|
1380
|
+
description: 'Get simplified events in a specific district',
|
|
1381
|
+
inputSchema: {
|
|
1382
|
+
type: 'object',
|
|
1383
|
+
properties: {
|
|
1384
|
+
district_key: {
|
|
1385
|
+
type: 'string',
|
|
1386
|
+
description: 'District key (e.g., 2023fim)',
|
|
1387
|
+
},
|
|
1388
|
+
},
|
|
1389
|
+
required: ['district_key'],
|
|
1390
|
+
},
|
|
1391
|
+
},
|
|
1392
|
+
{
|
|
1393
|
+
name: 'get_district_events_keys',
|
|
1394
|
+
description: 'Get event keys in a specific district',
|
|
1395
|
+
inputSchema: {
|
|
1396
|
+
type: 'object',
|
|
1397
|
+
properties: {
|
|
1398
|
+
district_key: {
|
|
1399
|
+
type: 'string',
|
|
1400
|
+
description: 'District key (e.g., 2023fim)',
|
|
1401
|
+
},
|
|
1402
|
+
},
|
|
1403
|
+
required: ['district_key'],
|
|
1404
|
+
},
|
|
1405
|
+
},
|
|
1406
|
+
{
|
|
1407
|
+
name: 'get_district_teams',
|
|
1408
|
+
description: 'Get teams in a specific district',
|
|
1409
|
+
inputSchema: {
|
|
1410
|
+
type: 'object',
|
|
1411
|
+
properties: {
|
|
1412
|
+
district_key: {
|
|
1413
|
+
type: 'string',
|
|
1414
|
+
description: 'District key (e.g., 2023fim)',
|
|
1415
|
+
},
|
|
1416
|
+
},
|
|
1417
|
+
required: ['district_key'],
|
|
1418
|
+
},
|
|
1419
|
+
},
|
|
1420
|
+
{
|
|
1421
|
+
name: 'get_district_teams_simple',
|
|
1422
|
+
description: 'Get simplified teams in a specific district',
|
|
1423
|
+
inputSchema: {
|
|
1424
|
+
type: 'object',
|
|
1425
|
+
properties: {
|
|
1426
|
+
district_key: {
|
|
1427
|
+
type: 'string',
|
|
1428
|
+
description: 'District key (e.g., 2023fim)',
|
|
1429
|
+
},
|
|
1430
|
+
},
|
|
1431
|
+
required: ['district_key'],
|
|
1432
|
+
},
|
|
1433
|
+
},
|
|
1434
|
+
{
|
|
1435
|
+
name: 'get_district_teams_keys',
|
|
1436
|
+
description: 'Get team keys in a specific district',
|
|
1437
|
+
inputSchema: {
|
|
1438
|
+
type: 'object',
|
|
1439
|
+
properties: {
|
|
1440
|
+
district_key: {
|
|
1441
|
+
type: 'string',
|
|
1442
|
+
description: 'District key (e.g., 2023fim)',
|
|
1443
|
+
},
|
|
1444
|
+
},
|
|
1445
|
+
required: ['district_key'],
|
|
1446
|
+
},
|
|
1447
|
+
},
|
|
1448
|
+
],
|
|
1449
|
+
};
|
|
1450
|
+
});
|
|
1451
|
+
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
1452
|
+
const { name, arguments: args } = request.params;
|
|
1453
|
+
try {
|
|
1454
|
+
switch (name) {
|
|
1455
|
+
case 'get_team': {
|
|
1456
|
+
const { team_key } = z
|
|
1457
|
+
.object({ team_key: TeamKeySchema })
|
|
1458
|
+
.parse(args);
|
|
1459
|
+
const data = await makeApiRequest(`/team/${team_key}`);
|
|
1460
|
+
const team = TeamSchema.parse(data);
|
|
1461
|
+
return {
|
|
1462
|
+
content: [
|
|
1463
|
+
{
|
|
1464
|
+
type: 'text',
|
|
1465
|
+
text: JSON.stringify(team, null, 2),
|
|
1466
|
+
},
|
|
1467
|
+
],
|
|
1468
|
+
};
|
|
1469
|
+
}
|
|
1470
|
+
case 'get_team_events': {
|
|
1471
|
+
const { team_key, year } = z
|
|
1472
|
+
.object({
|
|
1473
|
+
team_key: TeamKeySchema,
|
|
1474
|
+
year: YearSchema,
|
|
1475
|
+
})
|
|
1476
|
+
.parse(args);
|
|
1477
|
+
const data = await makeApiRequest(`/team/${team_key}/events/${year}`);
|
|
1478
|
+
const events = z.array(EventSchema).parse(data);
|
|
1479
|
+
return {
|
|
1480
|
+
content: [
|
|
1481
|
+
{
|
|
1482
|
+
type: 'text',
|
|
1483
|
+
text: JSON.stringify(events, null, 2),
|
|
1484
|
+
},
|
|
1485
|
+
],
|
|
1486
|
+
};
|
|
1487
|
+
}
|
|
1488
|
+
case 'get_team_awards': {
|
|
1489
|
+
const { team_key, year } = z
|
|
1490
|
+
.object({
|
|
1491
|
+
team_key: TeamKeySchema,
|
|
1492
|
+
year: YearSchema,
|
|
1493
|
+
})
|
|
1494
|
+
.parse(args);
|
|
1495
|
+
const data = await makeApiRequest(`/team/${team_key}/awards/${year}`);
|
|
1496
|
+
const awards = z.array(AwardSchema).parse(data);
|
|
1497
|
+
return {
|
|
1498
|
+
content: [
|
|
1499
|
+
{
|
|
1500
|
+
type: 'text',
|
|
1501
|
+
text: JSON.stringify(awards, null, 2),
|
|
1502
|
+
},
|
|
1503
|
+
],
|
|
1504
|
+
};
|
|
1505
|
+
}
|
|
1506
|
+
case 'get_team_matches': {
|
|
1507
|
+
const { team_key, year } = z
|
|
1508
|
+
.object({
|
|
1509
|
+
team_key: TeamKeySchema,
|
|
1510
|
+
year: YearSchema,
|
|
1511
|
+
})
|
|
1512
|
+
.parse(args);
|
|
1513
|
+
const data = await makeApiRequest(`/team/${team_key}/matches/${year}`);
|
|
1514
|
+
const matches = z.array(MatchSchema).parse(data);
|
|
1515
|
+
return {
|
|
1516
|
+
content: [
|
|
1517
|
+
{
|
|
1518
|
+
type: 'text',
|
|
1519
|
+
text: JSON.stringify(matches, null, 2),
|
|
1520
|
+
},
|
|
1521
|
+
],
|
|
1522
|
+
};
|
|
1523
|
+
}
|
|
1524
|
+
case 'get_events': {
|
|
1525
|
+
const { year } = z.object({ year: YearSchema }).parse(args);
|
|
1526
|
+
const data = await makeApiRequest(`/events/${year}`);
|
|
1527
|
+
const events = z.array(EventSchema).parse(data);
|
|
1528
|
+
return {
|
|
1529
|
+
content: [
|
|
1530
|
+
{
|
|
1531
|
+
type: 'text',
|
|
1532
|
+
text: JSON.stringify(events, null, 2),
|
|
1533
|
+
},
|
|
1534
|
+
],
|
|
1535
|
+
};
|
|
1536
|
+
}
|
|
1537
|
+
case 'get_event': {
|
|
1538
|
+
const { event_key } = z
|
|
1539
|
+
.object({ event_key: EventKeySchema })
|
|
1540
|
+
.parse(args);
|
|
1541
|
+
const data = await makeApiRequest(`/event/${event_key}`);
|
|
1542
|
+
const event = EventSchema.parse(data);
|
|
1543
|
+
return {
|
|
1544
|
+
content: [
|
|
1545
|
+
{
|
|
1546
|
+
type: 'text',
|
|
1547
|
+
text: JSON.stringify(event, null, 2),
|
|
1548
|
+
},
|
|
1549
|
+
],
|
|
1550
|
+
};
|
|
1551
|
+
}
|
|
1552
|
+
case 'get_event_teams': {
|
|
1553
|
+
const { event_key } = z
|
|
1554
|
+
.object({ event_key: EventKeySchema })
|
|
1555
|
+
.parse(args);
|
|
1556
|
+
const data = await makeApiRequest(`/event/${event_key}/teams`);
|
|
1557
|
+
const teams = z.array(TeamSchema).parse(data);
|
|
1558
|
+
return {
|
|
1559
|
+
content: [
|
|
1560
|
+
{
|
|
1561
|
+
type: 'text',
|
|
1562
|
+
text: JSON.stringify(teams, null, 2),
|
|
1563
|
+
},
|
|
1564
|
+
],
|
|
1565
|
+
};
|
|
1566
|
+
}
|
|
1567
|
+
case 'get_event_rankings': {
|
|
1568
|
+
const { event_key } = z
|
|
1569
|
+
.object({ event_key: EventKeySchema })
|
|
1570
|
+
.parse(args);
|
|
1571
|
+
const data = await makeApiRequest(`/event/${event_key}/rankings`);
|
|
1572
|
+
const rankings = RankingSchema.parse(data);
|
|
1573
|
+
return {
|
|
1574
|
+
content: [
|
|
1575
|
+
{
|
|
1576
|
+
type: 'text',
|
|
1577
|
+
text: JSON.stringify(rankings, null, 2),
|
|
1578
|
+
},
|
|
1579
|
+
],
|
|
1580
|
+
};
|
|
1581
|
+
}
|
|
1582
|
+
case 'get_event_matches': {
|
|
1583
|
+
const { event_key } = z
|
|
1584
|
+
.object({ event_key: EventKeySchema })
|
|
1585
|
+
.parse(args);
|
|
1586
|
+
const data = await makeApiRequest(`/event/${event_key}/matches`);
|
|
1587
|
+
const matches = z.array(MatchSchema).parse(data);
|
|
1588
|
+
return {
|
|
1589
|
+
content: [
|
|
1590
|
+
{
|
|
1591
|
+
type: 'text',
|
|
1592
|
+
text: JSON.stringify(matches, null, 2),
|
|
1593
|
+
},
|
|
1594
|
+
],
|
|
1595
|
+
};
|
|
1596
|
+
}
|
|
1597
|
+
case 'get_event_alliances': {
|
|
1598
|
+
const { event_key } = z
|
|
1599
|
+
.object({ event_key: EventKeySchema })
|
|
1600
|
+
.parse(args);
|
|
1601
|
+
const data = await makeApiRequest(`/event/${event_key}/alliances`);
|
|
1602
|
+
const alliances = z.array(AllianceSchema).parse(data);
|
|
1603
|
+
return {
|
|
1604
|
+
content: [
|
|
1605
|
+
{
|
|
1606
|
+
type: 'text',
|
|
1607
|
+
text: JSON.stringify(alliances, null, 2),
|
|
1608
|
+
},
|
|
1609
|
+
],
|
|
1610
|
+
};
|
|
1611
|
+
}
|
|
1612
|
+
case 'get_event_insights': {
|
|
1613
|
+
const { event_key } = z
|
|
1614
|
+
.object({ event_key: EventKeySchema })
|
|
1615
|
+
.parse(args);
|
|
1616
|
+
const data = await makeApiRequest(`/event/${event_key}/insights`);
|
|
1617
|
+
const insights = InsightsSchema.parse(data);
|
|
1618
|
+
return {
|
|
1619
|
+
content: [
|
|
1620
|
+
{
|
|
1621
|
+
type: 'text',
|
|
1622
|
+
text: JSON.stringify(insights, null, 2),
|
|
1623
|
+
},
|
|
1624
|
+
],
|
|
1625
|
+
};
|
|
1626
|
+
}
|
|
1627
|
+
case 'get_event_district_points': {
|
|
1628
|
+
const { event_key } = z
|
|
1629
|
+
.object({ event_key: EventKeySchema })
|
|
1630
|
+
.parse(args);
|
|
1631
|
+
const data = await makeApiRequest(`/event/${event_key}/district_points`);
|
|
1632
|
+
const districtPoints = DistrictPointsSchema.parse(data);
|
|
1633
|
+
return {
|
|
1634
|
+
content: [
|
|
1635
|
+
{
|
|
1636
|
+
type: 'text',
|
|
1637
|
+
text: JSON.stringify(districtPoints, null, 2),
|
|
1638
|
+
},
|
|
1639
|
+
],
|
|
1640
|
+
};
|
|
1641
|
+
}
|
|
1642
|
+
case 'get_team_years_participated': {
|
|
1643
|
+
const { team_key } = z
|
|
1644
|
+
.object({ team_key: TeamKeySchema })
|
|
1645
|
+
.parse(args);
|
|
1646
|
+
const data = await makeApiRequest(`/team/${team_key}/years_participated`);
|
|
1647
|
+
const years = z.array(z.number()).parse(data);
|
|
1648
|
+
return {
|
|
1649
|
+
content: [
|
|
1650
|
+
{
|
|
1651
|
+
type: 'text',
|
|
1652
|
+
text: JSON.stringify(years, null, 2),
|
|
1653
|
+
},
|
|
1654
|
+
],
|
|
1655
|
+
};
|
|
1656
|
+
}
|
|
1657
|
+
case 'get_team_districts': {
|
|
1658
|
+
const { team_key } = z
|
|
1659
|
+
.object({ team_key: TeamKeySchema })
|
|
1660
|
+
.parse(args);
|
|
1661
|
+
const data = await makeApiRequest(`/team/${team_key}/districts`);
|
|
1662
|
+
const districts = z.array(DistrictSchema).parse(data);
|
|
1663
|
+
return {
|
|
1664
|
+
content: [
|
|
1665
|
+
{
|
|
1666
|
+
type: 'text',
|
|
1667
|
+
text: JSON.stringify(districts, null, 2),
|
|
1668
|
+
},
|
|
1669
|
+
],
|
|
1670
|
+
};
|
|
1671
|
+
}
|
|
1672
|
+
case 'get_team_robots': {
|
|
1673
|
+
const { team_key } = z
|
|
1674
|
+
.object({ team_key: TeamKeySchema })
|
|
1675
|
+
.parse(args);
|
|
1676
|
+
const data = await makeApiRequest(`/team/${team_key}/robots`);
|
|
1677
|
+
const robots = z.array(RobotSchema).parse(data);
|
|
1678
|
+
return {
|
|
1679
|
+
content: [
|
|
1680
|
+
{
|
|
1681
|
+
type: 'text',
|
|
1682
|
+
text: JSON.stringify(robots, null, 2),
|
|
1683
|
+
},
|
|
1684
|
+
],
|
|
1685
|
+
};
|
|
1686
|
+
}
|
|
1687
|
+
case 'get_team_media': {
|
|
1688
|
+
const { team_key, year } = z
|
|
1689
|
+
.object({
|
|
1690
|
+
team_key: TeamKeySchema,
|
|
1691
|
+
year: YearSchema,
|
|
1692
|
+
})
|
|
1693
|
+
.parse(args);
|
|
1694
|
+
const data = await makeApiRequest(`/team/${team_key}/media/${year}`);
|
|
1695
|
+
const media = z.array(MediaSchema).parse(data);
|
|
1696
|
+
return {
|
|
1697
|
+
content: [
|
|
1698
|
+
{
|
|
1699
|
+
type: 'text',
|
|
1700
|
+
text: JSON.stringify(media, null, 2),
|
|
1701
|
+
},
|
|
1702
|
+
],
|
|
1703
|
+
};
|
|
1704
|
+
}
|
|
1705
|
+
case 'get_team_event_matches': {
|
|
1706
|
+
const { team_key, event_key } = z
|
|
1707
|
+
.object({
|
|
1708
|
+
team_key: TeamKeySchema,
|
|
1709
|
+
event_key: EventKeySchema,
|
|
1710
|
+
})
|
|
1711
|
+
.parse(args);
|
|
1712
|
+
const data = await makeApiRequest(`/team/${team_key}/event/${event_key}/matches`);
|
|
1713
|
+
const matches = z.array(MatchSchema).parse(data);
|
|
1714
|
+
return {
|
|
1715
|
+
content: [
|
|
1716
|
+
{
|
|
1717
|
+
type: 'text',
|
|
1718
|
+
text: JSON.stringify(matches, null, 2),
|
|
1719
|
+
},
|
|
1720
|
+
],
|
|
1721
|
+
};
|
|
1722
|
+
}
|
|
1723
|
+
case 'get_teams': {
|
|
1724
|
+
const { page_num } = z
|
|
1725
|
+
.object({ page_num: z.number().min(0) })
|
|
1726
|
+
.parse(args);
|
|
1727
|
+
const data = await makeApiRequest(`/teams/${page_num}`);
|
|
1728
|
+
const teams = z.array(TeamSchema).parse(data);
|
|
1729
|
+
return {
|
|
1730
|
+
content: [
|
|
1731
|
+
{
|
|
1732
|
+
type: 'text',
|
|
1733
|
+
text: JSON.stringify(teams, null, 2),
|
|
1734
|
+
},
|
|
1735
|
+
],
|
|
1736
|
+
};
|
|
1737
|
+
}
|
|
1738
|
+
case 'get_status': {
|
|
1739
|
+
const data = await makeApiRequest('/status');
|
|
1740
|
+
const status = StatusSchema.parse(data);
|
|
1741
|
+
return {
|
|
1742
|
+
content: [
|
|
1743
|
+
{
|
|
1744
|
+
type: 'text',
|
|
1745
|
+
text: JSON.stringify(status, null, 2),
|
|
1746
|
+
},
|
|
1747
|
+
],
|
|
1748
|
+
};
|
|
1749
|
+
}
|
|
1750
|
+
case 'get_match': {
|
|
1751
|
+
const { match_key } = z.object({ match_key: z.string() }).parse(args);
|
|
1752
|
+
const data = await makeApiRequest(`/match/${match_key}`);
|
|
1753
|
+
const match = MatchSchema.parse(data);
|
|
1754
|
+
return {
|
|
1755
|
+
content: [
|
|
1756
|
+
{
|
|
1757
|
+
type: 'text',
|
|
1758
|
+
text: JSON.stringify(match, null, 2),
|
|
1759
|
+
},
|
|
1760
|
+
],
|
|
1761
|
+
};
|
|
1762
|
+
}
|
|
1763
|
+
case 'get_event_oprs': {
|
|
1764
|
+
const { event_key } = z
|
|
1765
|
+
.object({ event_key: EventKeySchema })
|
|
1766
|
+
.parse(args);
|
|
1767
|
+
const data = await makeApiRequest(`/event/${event_key}/oprs`);
|
|
1768
|
+
const oprs = EventOPRsSchema.parse(data);
|
|
1769
|
+
return {
|
|
1770
|
+
content: [
|
|
1771
|
+
{
|
|
1772
|
+
type: 'text',
|
|
1773
|
+
text: JSON.stringify(oprs, null, 2),
|
|
1774
|
+
},
|
|
1775
|
+
],
|
|
1776
|
+
};
|
|
1777
|
+
}
|
|
1778
|
+
case 'get_event_awards': {
|
|
1779
|
+
const { event_key } = z
|
|
1780
|
+
.object({ event_key: EventKeySchema })
|
|
1781
|
+
.parse(args);
|
|
1782
|
+
const data = await makeApiRequest(`/event/${event_key}/awards`);
|
|
1783
|
+
const awards = z.array(AwardSchema).parse(data);
|
|
1784
|
+
return {
|
|
1785
|
+
content: [
|
|
1786
|
+
{
|
|
1787
|
+
type: 'text',
|
|
1788
|
+
text: JSON.stringify(awards, null, 2),
|
|
1789
|
+
},
|
|
1790
|
+
],
|
|
1791
|
+
};
|
|
1792
|
+
}
|
|
1793
|
+
case 'get_team_awards_all': {
|
|
1794
|
+
const { team_key } = z
|
|
1795
|
+
.object({ team_key: TeamKeySchema })
|
|
1796
|
+
.parse(args);
|
|
1797
|
+
const data = await makeApiRequest(`/team/${team_key}/awards`);
|
|
1798
|
+
const awards = z.array(AwardSchema).parse(data);
|
|
1799
|
+
return {
|
|
1800
|
+
content: [
|
|
1801
|
+
{
|
|
1802
|
+
type: 'text',
|
|
1803
|
+
text: JSON.stringify(awards, null, 2),
|
|
1804
|
+
},
|
|
1805
|
+
],
|
|
1806
|
+
};
|
|
1807
|
+
}
|
|
1808
|
+
case 'get_team_events_all': {
|
|
1809
|
+
const { team_key } = z
|
|
1810
|
+
.object({ team_key: TeamKeySchema })
|
|
1811
|
+
.parse(args);
|
|
1812
|
+
const data = await makeApiRequest(`/team/${team_key}/events`);
|
|
1813
|
+
const events = z.array(EventSchema).parse(data);
|
|
1814
|
+
return {
|
|
1815
|
+
content: [
|
|
1816
|
+
{
|
|
1817
|
+
type: 'text',
|
|
1818
|
+
text: JSON.stringify(events, null, 2),
|
|
1819
|
+
},
|
|
1820
|
+
],
|
|
1821
|
+
};
|
|
1822
|
+
}
|
|
1823
|
+
case 'get_team_event_status': {
|
|
1824
|
+
const { team_key, event_key } = z
|
|
1825
|
+
.object({
|
|
1826
|
+
team_key: TeamKeySchema,
|
|
1827
|
+
event_key: EventKeySchema,
|
|
1828
|
+
})
|
|
1829
|
+
.parse(args);
|
|
1830
|
+
const data = await makeApiRequest(`/team/${team_key}/event/${event_key}/status`);
|
|
1831
|
+
const status = TeamEventStatusSchema.parse(data);
|
|
1832
|
+
return {
|
|
1833
|
+
content: [
|
|
1834
|
+
{
|
|
1835
|
+
type: 'text',
|
|
1836
|
+
text: JSON.stringify(status, null, 2),
|
|
1837
|
+
},
|
|
1838
|
+
],
|
|
1839
|
+
};
|
|
1840
|
+
}
|
|
1841
|
+
case 'get_districts': {
|
|
1842
|
+
const { year } = z.object({ year: YearSchema }).parse(args);
|
|
1843
|
+
const data = await makeApiRequest(`/districts/${year}`);
|
|
1844
|
+
const districts = z.array(DistrictSchema).parse(data);
|
|
1845
|
+
return {
|
|
1846
|
+
content: [
|
|
1847
|
+
{
|
|
1848
|
+
type: 'text',
|
|
1849
|
+
text: JSON.stringify(districts, null, 2),
|
|
1850
|
+
},
|
|
1851
|
+
],
|
|
1852
|
+
};
|
|
1853
|
+
}
|
|
1854
|
+
case 'get_district_rankings': {
|
|
1855
|
+
const { district_key } = z
|
|
1856
|
+
.object({ district_key: z.string() })
|
|
1857
|
+
.parse(args);
|
|
1858
|
+
const data = await makeApiRequest(`/district/${district_key}/rankings`);
|
|
1859
|
+
const rankings = z.array(DistrictRankingSchema).parse(data);
|
|
1860
|
+
return {
|
|
1861
|
+
content: [
|
|
1862
|
+
{
|
|
1863
|
+
type: 'text',
|
|
1864
|
+
text: JSON.stringify(rankings, null, 2),
|
|
1865
|
+
},
|
|
1866
|
+
],
|
|
1867
|
+
};
|
|
1868
|
+
}
|
|
1869
|
+
case 'get_teams_simple': {
|
|
1870
|
+
const { page_num } = z
|
|
1871
|
+
.object({ page_num: z.number().min(0) })
|
|
1872
|
+
.parse(args);
|
|
1873
|
+
const data = await makeApiRequest(`/teams/${page_num}/simple`);
|
|
1874
|
+
const teams = z.array(TeamSimpleSchema).parse(data);
|
|
1875
|
+
return {
|
|
1876
|
+
content: [
|
|
1877
|
+
{
|
|
1878
|
+
type: 'text',
|
|
1879
|
+
text: JSON.stringify(teams, null, 2),
|
|
1880
|
+
},
|
|
1881
|
+
],
|
|
1882
|
+
};
|
|
1883
|
+
}
|
|
1884
|
+
case 'get_teams_keys': {
|
|
1885
|
+
const { page_num } = z
|
|
1886
|
+
.object({ page_num: z.number().min(0) })
|
|
1887
|
+
.parse(args);
|
|
1888
|
+
const data = await makeApiRequest(`/teams/${page_num}/keys`);
|
|
1889
|
+
const keys = z.array(z.string()).parse(data);
|
|
1890
|
+
return {
|
|
1891
|
+
content: [
|
|
1892
|
+
{
|
|
1893
|
+
type: 'text',
|
|
1894
|
+
text: JSON.stringify(keys, null, 2),
|
|
1895
|
+
},
|
|
1896
|
+
],
|
|
1897
|
+
};
|
|
1898
|
+
}
|
|
1899
|
+
case 'get_teams_by_year': {
|
|
1900
|
+
const { year, page_num } = z
|
|
1901
|
+
.object({
|
|
1902
|
+
year: YearSchema,
|
|
1903
|
+
page_num: z.number().min(0),
|
|
1904
|
+
})
|
|
1905
|
+
.parse(args);
|
|
1906
|
+
const data = await makeApiRequest(`/teams/${year}/${page_num}`);
|
|
1907
|
+
const teams = z.array(TeamSchema).parse(data);
|
|
1908
|
+
return {
|
|
1909
|
+
content: [
|
|
1910
|
+
{
|
|
1911
|
+
type: 'text',
|
|
1912
|
+
text: JSON.stringify(teams, null, 2),
|
|
1913
|
+
},
|
|
1914
|
+
],
|
|
1915
|
+
};
|
|
1916
|
+
}
|
|
1917
|
+
case 'get_teams_by_year_simple': {
|
|
1918
|
+
const { year, page_num } = z
|
|
1919
|
+
.object({
|
|
1920
|
+
year: YearSchema,
|
|
1921
|
+
page_num: z.number().min(0),
|
|
1922
|
+
})
|
|
1923
|
+
.parse(args);
|
|
1924
|
+
const data = await makeApiRequest(`/teams/${year}/${page_num}/simple`);
|
|
1925
|
+
const teams = z.array(TeamSimpleSchema).parse(data);
|
|
1926
|
+
return {
|
|
1927
|
+
content: [
|
|
1928
|
+
{
|
|
1929
|
+
type: 'text',
|
|
1930
|
+
text: JSON.stringify(teams, null, 2),
|
|
1931
|
+
},
|
|
1932
|
+
],
|
|
1933
|
+
};
|
|
1934
|
+
}
|
|
1935
|
+
case 'get_teams_by_year_keys': {
|
|
1936
|
+
const { year, page_num } = z
|
|
1937
|
+
.object({
|
|
1938
|
+
year: YearSchema,
|
|
1939
|
+
page_num: z.number().min(0),
|
|
1940
|
+
})
|
|
1941
|
+
.parse(args);
|
|
1942
|
+
const data = await makeApiRequest(`/teams/${year}/${page_num}/keys`);
|
|
1943
|
+
const keys = z.array(z.string()).parse(data);
|
|
1944
|
+
return {
|
|
1945
|
+
content: [
|
|
1946
|
+
{
|
|
1947
|
+
type: 'text',
|
|
1948
|
+
text: JSON.stringify(keys, null, 2),
|
|
1949
|
+
},
|
|
1950
|
+
],
|
|
1951
|
+
};
|
|
1952
|
+
}
|
|
1953
|
+
case 'get_team_simple': {
|
|
1954
|
+
const { team_key } = z
|
|
1955
|
+
.object({ team_key: TeamKeySchema })
|
|
1956
|
+
.parse(args);
|
|
1957
|
+
const data = await makeApiRequest(`/team/${team_key}/simple`);
|
|
1958
|
+
const team = TeamSimpleSchema.parse(data);
|
|
1959
|
+
return {
|
|
1960
|
+
content: [
|
|
1961
|
+
{
|
|
1962
|
+
type: 'text',
|
|
1963
|
+
text: JSON.stringify(team, null, 2),
|
|
1964
|
+
},
|
|
1965
|
+
],
|
|
1966
|
+
};
|
|
1967
|
+
}
|
|
1968
|
+
case 'get_event_simple': {
|
|
1969
|
+
const { event_key } = z
|
|
1970
|
+
.object({ event_key: EventKeySchema })
|
|
1971
|
+
.parse(args);
|
|
1972
|
+
const data = await makeApiRequest(`/event/${event_key}/simple`);
|
|
1973
|
+
const event = EventSimpleSchema.parse(data);
|
|
1974
|
+
return {
|
|
1975
|
+
content: [
|
|
1976
|
+
{
|
|
1977
|
+
type: 'text',
|
|
1978
|
+
text: JSON.stringify(event, null, 2),
|
|
1979
|
+
},
|
|
1980
|
+
],
|
|
1981
|
+
};
|
|
1982
|
+
}
|
|
1983
|
+
case 'get_events_simple': {
|
|
1984
|
+
const { year } = z.object({ year: YearSchema }).parse(args);
|
|
1985
|
+
const data = await makeApiRequest(`/events/${year}/simple`);
|
|
1986
|
+
const events = z.array(EventSimpleSchema).parse(data);
|
|
1987
|
+
return {
|
|
1988
|
+
content: [
|
|
1989
|
+
{
|
|
1990
|
+
type: 'text',
|
|
1991
|
+
text: JSON.stringify(events, null, 2),
|
|
1992
|
+
},
|
|
1993
|
+
],
|
|
1994
|
+
};
|
|
1995
|
+
}
|
|
1996
|
+
case 'get_events_keys': {
|
|
1997
|
+
const { year } = z.object({ year: YearSchema }).parse(args);
|
|
1998
|
+
const data = await makeApiRequest(`/events/${year}/keys`);
|
|
1999
|
+
const keys = z.array(z.string()).parse(data);
|
|
2000
|
+
return {
|
|
2001
|
+
content: [
|
|
2002
|
+
{
|
|
2003
|
+
type: 'text',
|
|
2004
|
+
text: JSON.stringify(keys, null, 2),
|
|
2005
|
+
},
|
|
2006
|
+
],
|
|
2007
|
+
};
|
|
2008
|
+
}
|
|
2009
|
+
case 'get_match_simple': {
|
|
2010
|
+
const { match_key } = z.object({ match_key: z.string() }).parse(args);
|
|
2011
|
+
const data = await makeApiRequest(`/match/${match_key}/simple`);
|
|
2012
|
+
const match = MatchSimpleSchema.parse(data);
|
|
2013
|
+
return {
|
|
2014
|
+
content: [
|
|
2015
|
+
{
|
|
2016
|
+
type: 'text',
|
|
2017
|
+
text: JSON.stringify(match, null, 2),
|
|
2018
|
+
},
|
|
2019
|
+
],
|
|
2020
|
+
};
|
|
2021
|
+
}
|
|
2022
|
+
case 'get_team_events_simple': {
|
|
2023
|
+
const { team_key, year } = z
|
|
2024
|
+
.object({
|
|
2025
|
+
team_key: TeamKeySchema,
|
|
2026
|
+
year: YearSchema,
|
|
2027
|
+
})
|
|
2028
|
+
.parse(args);
|
|
2029
|
+
const data = await makeApiRequest(`/team/${team_key}/events/${year}/simple`);
|
|
2030
|
+
const events = z.array(EventSimpleSchema).parse(data);
|
|
2031
|
+
return {
|
|
2032
|
+
content: [
|
|
2033
|
+
{
|
|
2034
|
+
type: 'text',
|
|
2035
|
+
text: JSON.stringify(events, null, 2),
|
|
2036
|
+
},
|
|
2037
|
+
],
|
|
2038
|
+
};
|
|
2039
|
+
}
|
|
2040
|
+
case 'get_team_events_keys': {
|
|
2041
|
+
const { team_key, year } = z
|
|
2042
|
+
.object({
|
|
2043
|
+
team_key: TeamKeySchema,
|
|
2044
|
+
year: YearSchema,
|
|
2045
|
+
})
|
|
2046
|
+
.parse(args);
|
|
2047
|
+
const data = await makeApiRequest(`/team/${team_key}/events/${year}/keys`);
|
|
2048
|
+
const keys = z.array(z.string()).parse(data);
|
|
2049
|
+
return {
|
|
2050
|
+
content: [
|
|
2051
|
+
{
|
|
2052
|
+
type: 'text',
|
|
2053
|
+
text: JSON.stringify(keys, null, 2),
|
|
2054
|
+
},
|
|
2055
|
+
],
|
|
2056
|
+
};
|
|
2057
|
+
}
|
|
2058
|
+
case 'get_team_event_awards': {
|
|
2059
|
+
const { team_key, event_key } = z
|
|
2060
|
+
.object({
|
|
2061
|
+
team_key: TeamKeySchema,
|
|
2062
|
+
event_key: EventKeySchema,
|
|
2063
|
+
})
|
|
2064
|
+
.parse(args);
|
|
2065
|
+
const data = await makeApiRequest(`/team/${team_key}/event/${event_key}/awards`);
|
|
2066
|
+
const awards = z.array(AwardSchema).parse(data);
|
|
2067
|
+
return {
|
|
2068
|
+
content: [
|
|
2069
|
+
{
|
|
2070
|
+
type: 'text',
|
|
2071
|
+
text: JSON.stringify(awards, null, 2),
|
|
2072
|
+
},
|
|
2073
|
+
],
|
|
2074
|
+
};
|
|
2075
|
+
}
|
|
2076
|
+
case 'get_team_matches_simple': {
|
|
2077
|
+
const { team_key, year } = z
|
|
2078
|
+
.object({
|
|
2079
|
+
team_key: TeamKeySchema,
|
|
2080
|
+
year: YearSchema,
|
|
2081
|
+
})
|
|
2082
|
+
.parse(args);
|
|
2083
|
+
const data = await makeApiRequest(`/team/${team_key}/matches/${year}/simple`);
|
|
2084
|
+
const matches = z.array(MatchSimpleSchema).parse(data);
|
|
2085
|
+
return {
|
|
2086
|
+
content: [
|
|
2087
|
+
{
|
|
2088
|
+
type: 'text',
|
|
2089
|
+
text: JSON.stringify(matches, null, 2),
|
|
2090
|
+
},
|
|
2091
|
+
],
|
|
2092
|
+
};
|
|
2093
|
+
}
|
|
2094
|
+
case 'get_team_matches_keys': {
|
|
2095
|
+
const { team_key, year } = z
|
|
2096
|
+
.object({
|
|
2097
|
+
team_key: TeamKeySchema,
|
|
2098
|
+
year: YearSchema,
|
|
2099
|
+
})
|
|
2100
|
+
.parse(args);
|
|
2101
|
+
const data = await makeApiRequest(`/team/${team_key}/matches/${year}/keys`);
|
|
2102
|
+
const keys = z.array(z.string()).parse(data);
|
|
2103
|
+
return {
|
|
2104
|
+
content: [
|
|
2105
|
+
{
|
|
2106
|
+
type: 'text',
|
|
2107
|
+
text: JSON.stringify(keys, null, 2),
|
|
2108
|
+
},
|
|
2109
|
+
],
|
|
2110
|
+
};
|
|
2111
|
+
}
|
|
2112
|
+
case 'get_team_social_media': {
|
|
2113
|
+
const { team_key } = z
|
|
2114
|
+
.object({ team_key: TeamKeySchema })
|
|
2115
|
+
.parse(args);
|
|
2116
|
+
const data = await makeApiRequest(`/team/${team_key}/social_media`);
|
|
2117
|
+
const media = z.array(MediaSchema).parse(data);
|
|
2118
|
+
return {
|
|
2119
|
+
content: [
|
|
2120
|
+
{
|
|
2121
|
+
type: 'text',
|
|
2122
|
+
text: JSON.stringify(media, null, 2),
|
|
2123
|
+
},
|
|
2124
|
+
],
|
|
2125
|
+
};
|
|
2126
|
+
}
|
|
2127
|
+
case 'get_team_media_by_tag': {
|
|
2128
|
+
const { team_key, media_tag } = z
|
|
2129
|
+
.object({
|
|
2130
|
+
team_key: TeamKeySchema,
|
|
2131
|
+
media_tag: z.string(),
|
|
2132
|
+
})
|
|
2133
|
+
.parse(args);
|
|
2134
|
+
const data = await makeApiRequest(`/team/${team_key}/media/tag/${media_tag}`);
|
|
2135
|
+
const media = z.array(MediaSchema).parse(data);
|
|
2136
|
+
return {
|
|
2137
|
+
content: [
|
|
2138
|
+
{
|
|
2139
|
+
type: 'text',
|
|
2140
|
+
text: JSON.stringify(media, null, 2),
|
|
2141
|
+
},
|
|
2142
|
+
],
|
|
2143
|
+
};
|
|
2144
|
+
}
|
|
2145
|
+
case 'get_team_media_by_tag_year': {
|
|
2146
|
+
const { team_key, media_tag, year } = z
|
|
2147
|
+
.object({
|
|
2148
|
+
team_key: TeamKeySchema,
|
|
2149
|
+
media_tag: z.string(),
|
|
2150
|
+
year: YearSchema,
|
|
2151
|
+
})
|
|
2152
|
+
.parse(args);
|
|
2153
|
+
const data = await makeApiRequest(`/team/${team_key}/media/tag/${media_tag}/${year}`);
|
|
2154
|
+
const media = z.array(MediaSchema).parse(data);
|
|
2155
|
+
return {
|
|
2156
|
+
content: [
|
|
2157
|
+
{
|
|
2158
|
+
type: 'text',
|
|
2159
|
+
text: JSON.stringify(media, null, 2),
|
|
2160
|
+
},
|
|
2161
|
+
],
|
|
2162
|
+
};
|
|
2163
|
+
}
|
|
2164
|
+
case 'get_event_teams_simple': {
|
|
2165
|
+
const { event_key } = z
|
|
2166
|
+
.object({ event_key: EventKeySchema })
|
|
2167
|
+
.parse(args);
|
|
2168
|
+
const data = await makeApiRequest(`/event/${event_key}/teams/simple`);
|
|
2169
|
+
const teams = z.array(TeamSimpleSchema).parse(data);
|
|
2170
|
+
return {
|
|
2171
|
+
content: [
|
|
2172
|
+
{
|
|
2173
|
+
type: 'text',
|
|
2174
|
+
text: JSON.stringify(teams, null, 2),
|
|
2175
|
+
},
|
|
2176
|
+
],
|
|
2177
|
+
};
|
|
2178
|
+
}
|
|
2179
|
+
case 'get_event_teams_keys': {
|
|
2180
|
+
const { event_key } = z
|
|
2181
|
+
.object({ event_key: EventKeySchema })
|
|
2182
|
+
.parse(args);
|
|
2183
|
+
const data = await makeApiRequest(`/event/${event_key}/teams/keys`);
|
|
2184
|
+
const keys = z.array(z.string()).parse(data);
|
|
2185
|
+
return {
|
|
2186
|
+
content: [
|
|
2187
|
+
{
|
|
2188
|
+
type: 'text',
|
|
2189
|
+
text: JSON.stringify(keys, null, 2),
|
|
2190
|
+
},
|
|
2191
|
+
],
|
|
2192
|
+
};
|
|
2193
|
+
}
|
|
2194
|
+
case 'get_event_matches_simple': {
|
|
2195
|
+
const { event_key } = z
|
|
2196
|
+
.object({ event_key: EventKeySchema })
|
|
2197
|
+
.parse(args);
|
|
2198
|
+
const data = await makeApiRequest(`/event/${event_key}/matches/simple`);
|
|
2199
|
+
const matches = z.array(MatchSimpleSchema).parse(data);
|
|
2200
|
+
return {
|
|
2201
|
+
content: [
|
|
2202
|
+
{
|
|
2203
|
+
type: 'text',
|
|
2204
|
+
text: JSON.stringify(matches, null, 2),
|
|
2205
|
+
},
|
|
2206
|
+
],
|
|
2207
|
+
};
|
|
2208
|
+
}
|
|
2209
|
+
case 'get_event_matches_keys': {
|
|
2210
|
+
const { event_key } = z
|
|
2211
|
+
.object({ event_key: EventKeySchema })
|
|
2212
|
+
.parse(args);
|
|
2213
|
+
const data = await makeApiRequest(`/event/${event_key}/matches/keys`);
|
|
2214
|
+
const keys = z.array(z.string()).parse(data);
|
|
2215
|
+
return {
|
|
2216
|
+
content: [
|
|
2217
|
+
{
|
|
2218
|
+
type: 'text',
|
|
2219
|
+
text: JSON.stringify(keys, null, 2),
|
|
2220
|
+
},
|
|
2221
|
+
],
|
|
2222
|
+
};
|
|
2223
|
+
}
|
|
2224
|
+
case 'get_team_history': {
|
|
2225
|
+
const { team_key } = z
|
|
2226
|
+
.object({ team_key: TeamKeySchema })
|
|
2227
|
+
.parse(args);
|
|
2228
|
+
const data = await makeApiRequest(`/team/${team_key}/history`);
|
|
2229
|
+
const history = TeamHistorySchema.parse(data);
|
|
2230
|
+
return {
|
|
2231
|
+
content: [
|
|
2232
|
+
{
|
|
2233
|
+
type: 'text',
|
|
2234
|
+
text: JSON.stringify(history, null, 2),
|
|
2235
|
+
},
|
|
2236
|
+
],
|
|
2237
|
+
};
|
|
2238
|
+
}
|
|
2239
|
+
case 'get_team_event_statuses': {
|
|
2240
|
+
const { team_key, year } = z
|
|
2241
|
+
.object({
|
|
2242
|
+
team_key: TeamKeySchema,
|
|
2243
|
+
year: YearSchema,
|
|
2244
|
+
})
|
|
2245
|
+
.parse(args);
|
|
2246
|
+
const data = await makeApiRequest(`/team/${team_key}/events/${year}/statuses`);
|
|
2247
|
+
const statuses = z
|
|
2248
|
+
.record(z.string(), TeamEventStatusSchema)
|
|
2249
|
+
.parse(data);
|
|
2250
|
+
return {
|
|
2251
|
+
content: [
|
|
2252
|
+
{
|
|
2253
|
+
type: 'text',
|
|
2254
|
+
text: JSON.stringify(statuses, null, 2),
|
|
2255
|
+
},
|
|
2256
|
+
],
|
|
2257
|
+
};
|
|
2258
|
+
}
|
|
2259
|
+
case 'get_team_event_matches_simple': {
|
|
2260
|
+
const { team_key, event_key } = z
|
|
2261
|
+
.object({
|
|
2262
|
+
team_key: TeamKeySchema,
|
|
2263
|
+
event_key: EventKeySchema,
|
|
2264
|
+
})
|
|
2265
|
+
.parse(args);
|
|
2266
|
+
const data = await makeApiRequest(`/team/${team_key}/event/${event_key}/matches/simple`);
|
|
2267
|
+
const matches = z.array(MatchSimpleSchema).parse(data);
|
|
2268
|
+
return {
|
|
2269
|
+
content: [
|
|
2270
|
+
{
|
|
2271
|
+
type: 'text',
|
|
2272
|
+
text: JSON.stringify(matches, null, 2),
|
|
2273
|
+
},
|
|
2274
|
+
],
|
|
2275
|
+
};
|
|
2276
|
+
}
|
|
2277
|
+
case 'get_team_event_matches_keys': {
|
|
2278
|
+
const { team_key, event_key } = z
|
|
2279
|
+
.object({
|
|
2280
|
+
team_key: TeamKeySchema,
|
|
2281
|
+
event_key: EventKeySchema,
|
|
2282
|
+
})
|
|
2283
|
+
.parse(args);
|
|
2284
|
+
const data = await makeApiRequest(`/team/${team_key}/event/${event_key}/matches/keys`);
|
|
2285
|
+
const keys = z.array(z.string()).parse(data);
|
|
2286
|
+
return {
|
|
2287
|
+
content: [
|
|
2288
|
+
{
|
|
2289
|
+
type: 'text',
|
|
2290
|
+
text: JSON.stringify(keys, null, 2),
|
|
2291
|
+
},
|
|
2292
|
+
],
|
|
2293
|
+
};
|
|
2294
|
+
}
|
|
2295
|
+
case 'get_district_events': {
|
|
2296
|
+
const { district_key } = z
|
|
2297
|
+
.object({ district_key: z.string() })
|
|
2298
|
+
.parse(args);
|
|
2299
|
+
const data = await makeApiRequest(`/district/${district_key}/events`);
|
|
2300
|
+
const events = z.array(EventSchema).parse(data);
|
|
2301
|
+
return {
|
|
2302
|
+
content: [
|
|
2303
|
+
{
|
|
2304
|
+
type: 'text',
|
|
2305
|
+
text: JSON.stringify(events, null, 2),
|
|
2306
|
+
},
|
|
2307
|
+
],
|
|
2308
|
+
};
|
|
2309
|
+
}
|
|
2310
|
+
case 'get_district_events_simple': {
|
|
2311
|
+
const { district_key } = z
|
|
2312
|
+
.object({ district_key: z.string() })
|
|
2313
|
+
.parse(args);
|
|
2314
|
+
const data = await makeApiRequest(`/district/${district_key}/events/simple`);
|
|
2315
|
+
const events = z.array(EventSimpleSchema).parse(data);
|
|
2316
|
+
return {
|
|
2317
|
+
content: [
|
|
2318
|
+
{
|
|
2319
|
+
type: 'text',
|
|
2320
|
+
text: JSON.stringify(events, null, 2),
|
|
2321
|
+
},
|
|
2322
|
+
],
|
|
2323
|
+
};
|
|
2324
|
+
}
|
|
2325
|
+
case 'get_district_events_keys': {
|
|
2326
|
+
const { district_key } = z
|
|
2327
|
+
.object({ district_key: z.string() })
|
|
2328
|
+
.parse(args);
|
|
2329
|
+
const data = await makeApiRequest(`/district/${district_key}/events/keys`);
|
|
2330
|
+
const keys = z.array(z.string()).parse(data);
|
|
2331
|
+
return {
|
|
2332
|
+
content: [
|
|
2333
|
+
{
|
|
2334
|
+
type: 'text',
|
|
2335
|
+
text: JSON.stringify(keys, null, 2),
|
|
2336
|
+
},
|
|
2337
|
+
],
|
|
2338
|
+
};
|
|
2339
|
+
}
|
|
2340
|
+
case 'get_district_teams': {
|
|
2341
|
+
const { district_key } = z
|
|
2342
|
+
.object({ district_key: z.string() })
|
|
2343
|
+
.parse(args);
|
|
2344
|
+
const data = await makeApiRequest(`/district/${district_key}/teams`);
|
|
2345
|
+
const teams = z.array(TeamSchema).parse(data);
|
|
2346
|
+
return {
|
|
2347
|
+
content: [
|
|
2348
|
+
{
|
|
2349
|
+
type: 'text',
|
|
2350
|
+
text: JSON.stringify(teams, null, 2),
|
|
2351
|
+
},
|
|
2352
|
+
],
|
|
2353
|
+
};
|
|
2354
|
+
}
|
|
2355
|
+
case 'get_district_teams_simple': {
|
|
2356
|
+
const { district_key } = z
|
|
2357
|
+
.object({ district_key: z.string() })
|
|
2358
|
+
.parse(args);
|
|
2359
|
+
const data = await makeApiRequest(`/district/${district_key}/teams/simple`);
|
|
2360
|
+
const teams = z.array(TeamSimpleSchema).parse(data);
|
|
2361
|
+
return {
|
|
2362
|
+
content: [
|
|
2363
|
+
{
|
|
2364
|
+
type: 'text',
|
|
2365
|
+
text: JSON.stringify(teams, null, 2),
|
|
2366
|
+
},
|
|
2367
|
+
],
|
|
2368
|
+
};
|
|
2369
|
+
}
|
|
2370
|
+
case 'get_district_teams_keys': {
|
|
2371
|
+
const { district_key } = z
|
|
2372
|
+
.object({ district_key: z.string() })
|
|
2373
|
+
.parse(args);
|
|
2374
|
+
const data = await makeApiRequest(`/district/${district_key}/teams/keys`);
|
|
2375
|
+
const keys = z.array(z.string()).parse(data);
|
|
2376
|
+
return {
|
|
2377
|
+
content: [
|
|
2378
|
+
{
|
|
2379
|
+
type: 'text',
|
|
2380
|
+
text: JSON.stringify(keys, null, 2),
|
|
2381
|
+
},
|
|
2382
|
+
],
|
|
2383
|
+
};
|
|
2384
|
+
}
|
|
2385
|
+
case 'get_match_zebra': {
|
|
2386
|
+
const { match_key } = z.object({ match_key: z.string() }).parse(args);
|
|
2387
|
+
const data = await makeApiRequest(`/match/${match_key}/zebra`);
|
|
2388
|
+
const zebra = ZebraSchema.parse(data);
|
|
2389
|
+
return {
|
|
2390
|
+
content: [
|
|
2391
|
+
{
|
|
2392
|
+
type: 'text',
|
|
2393
|
+
text: JSON.stringify(zebra, null, 2),
|
|
2394
|
+
},
|
|
2395
|
+
],
|
|
2396
|
+
};
|
|
2397
|
+
}
|
|
2398
|
+
case 'get_event_predictions': {
|
|
2399
|
+
const { event_key } = z
|
|
2400
|
+
.object({ event_key: EventKeySchema })
|
|
2401
|
+
.parse(args);
|
|
2402
|
+
const data = await makeApiRequest(`/event/${event_key}/predictions`);
|
|
2403
|
+
const predictions = PredictionSchema.parse(data);
|
|
2404
|
+
return {
|
|
2405
|
+
content: [
|
|
2406
|
+
{
|
|
2407
|
+
type: 'text',
|
|
2408
|
+
text: JSON.stringify(predictions, null, 2),
|
|
2409
|
+
},
|
|
2410
|
+
],
|
|
2411
|
+
};
|
|
2412
|
+
}
|
|
2413
|
+
default:
|
|
2414
|
+
throw new Error(`Unknown tool: ${name}`);
|
|
2415
|
+
}
|
|
2416
|
+
}
|
|
2417
|
+
catch (error) {
|
|
2418
|
+
return {
|
|
2419
|
+
content: [
|
|
2420
|
+
{
|
|
2421
|
+
type: 'text',
|
|
2422
|
+
text: `Error: ${error instanceof Error ? error.message : String(error)}`,
|
|
2423
|
+
},
|
|
2424
|
+
],
|
|
2425
|
+
isError: true,
|
|
2426
|
+
};
|
|
2427
|
+
}
|
|
2428
|
+
});
|
|
2429
|
+
const transport = new StdioServerTransport();
|
|
2430
|
+
await server.connect(transport);
|
|
2431
|
+
console.error('The Blue Alliance MCP Server running on stdio');
|
|
2432
|
+
}
|
|
2433
|
+
// Only run the server if this file is executed directly
|
|
2434
|
+
// Check if this is the main module by comparing file paths
|
|
2435
|
+
const isMainModule = process.argv[1] && process.argv[1].endsWith('index.js');
|
|
2436
|
+
if (isMainModule) {
|
|
2437
|
+
runServer().catch((error) => {
|
|
2438
|
+
console.error('Fatal error running server:', error);
|
|
2439
|
+
process.exit(1);
|
|
2440
|
+
});
|
|
2441
|
+
}
|
|
2442
|
+
//# sourceMappingURL=index.js.map
|