@with-thesis/mcp 0.1.4 → 0.1.6
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/README.md +4 -0
- package/dist/index.js +145 -9
- package/dist/stdio.js +163 -11
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -15348,12 +15348,16 @@ function setHeaders(ctx, headersToSet) {
|
|
|
15348
15348
|
}
|
|
15349
15349
|
|
|
15350
15350
|
// src/lib/config.ts
|
|
15351
|
-
var MCP_VERSION = "0.1.
|
|
15351
|
+
var MCP_VERSION = "0.1.5";
|
|
15352
15352
|
var DEFAULT_API_URL = "https://api.withthesis.dev";
|
|
15353
15353
|
var DEFAULT_MCP_PORT = 4100;
|
|
15354
15354
|
var DEFAULT_MCP_RATE_LIMIT_REQUESTS_PER_MIN = 300;
|
|
15355
|
+
function trimEnv(value) {
|
|
15356
|
+
const trimmed = value?.trim();
|
|
15357
|
+
return trimmed ? trimmed : null;
|
|
15358
|
+
}
|
|
15355
15359
|
function resolveApiBaseUrl() {
|
|
15356
|
-
return process.env.THESIS_API_URL
|
|
15360
|
+
return trimEnv(process.env.THESIS_API_URL) || DEFAULT_API_URL;
|
|
15357
15361
|
}
|
|
15358
15362
|
function resolveHttpPort() {
|
|
15359
15363
|
return Number(process.env.PORT) || Number(process.env.MCP_PORT) || DEFAULT_MCP_PORT;
|
|
@@ -23136,7 +23140,7 @@ var SportSchema = _enum(["nba"]).default("nba");
|
|
|
23136
23140
|
function registerBookmakerTools(server, api2) {
|
|
23137
23141
|
server.registerTool("get_bookmakers", {
|
|
23138
23142
|
title: "Get Bookmakers",
|
|
23139
|
-
description: "List
|
|
23143
|
+
description: "List bookmakers with sharp, opener, and active filters.",
|
|
23140
23144
|
inputSchema: {
|
|
23141
23145
|
sport: SportSchema.describe("Sport code. Only nba is currently supported."),
|
|
23142
23146
|
sharp: boolean2().optional().describe("Filter to sharp bookmakers only."),
|
|
@@ -23166,7 +23170,7 @@ var SportSchema2 = _enum(["nba"]).default("nba");
|
|
|
23166
23170
|
function registerBoxscoreTools(server, api2) {
|
|
23167
23171
|
server.registerTool("get_boxscore", {
|
|
23168
23172
|
title: "Get Box Score",
|
|
23169
|
-
description: "Get the full team-level box score for a single
|
|
23173
|
+
description: "Get the full team-level box score for a single game.",
|
|
23170
23174
|
inputSchema: {
|
|
23171
23175
|
sport: SportSchema2.describe("Sport code. Only nba is currently supported."),
|
|
23172
23176
|
game_id: string2().describe("Game ID such as 20260308_1310_NBA_BOS_CLE.")
|
|
@@ -23193,7 +23197,7 @@ var PaginationOffsetSchema = number2().int().min(0).optional();
|
|
|
23193
23197
|
function registerGameTools(server, api2) {
|
|
23194
23198
|
server.registerTool("get_games", {
|
|
23195
23199
|
title: "Get Games",
|
|
23196
|
-
description: "
|
|
23200
|
+
description: "List games by date, date range, team, status, or season.",
|
|
23197
23201
|
inputSchema: {
|
|
23198
23202
|
sport: SportSchema3.describe("Sport code. Only nba is currently supported."),
|
|
23199
23203
|
date: string2().optional().describe("Game date in YYYY-MM-DD format."),
|
|
@@ -23228,7 +23232,7 @@ function registerGameTools(server, api2) {
|
|
|
23228
23232
|
});
|
|
23229
23233
|
server.registerTool("get_game", {
|
|
23230
23234
|
title: "Get Game",
|
|
23231
|
-
description: "Get a single
|
|
23235
|
+
description: "Get a single game with scores, officials, and partial box score details.",
|
|
23232
23236
|
inputSchema: {
|
|
23233
23237
|
sport: SportSchema3.describe("Sport code. Only nba is currently supported."),
|
|
23234
23238
|
game_id: string2().describe("Game ID such as 20260308_1310_NBA_BOS_CLE.")
|
|
@@ -23255,10 +23259,10 @@ var PaginationOffsetSchema2 = number2().int().min(0).optional();
|
|
|
23255
23259
|
function registerOddsTools(server, api2) {
|
|
23256
23260
|
server.registerTool("get_odds", {
|
|
23257
23261
|
title: "Get Odds",
|
|
23258
|
-
description: "Get current
|
|
23262
|
+
description: "Get current odds snapshots by game, date, bookmaker, sharp books, opener books, or line type.",
|
|
23259
23263
|
inputSchema: {
|
|
23260
23264
|
sport: SportSchema4.describe("Sport code. Only nba is currently supported."),
|
|
23261
|
-
game_id: string2().optional().describe("Filter to a specific
|
|
23265
|
+
game_id: string2().optional().describe("Filter to a specific game ID."),
|
|
23262
23266
|
date: string2().optional().describe("Game date in YYYY-MM-DD format."),
|
|
23263
23267
|
bookmaker: string2().optional().describe("Comma-separated bookmaker codes such as circa,dk."),
|
|
23264
23268
|
sharp: boolean2().optional().describe("Filter to sharp bookmakers only."),
|
|
@@ -23290,7 +23294,7 @@ function registerOddsTools(server, api2) {
|
|
|
23290
23294
|
});
|
|
23291
23295
|
server.registerTool("get_line_movement", {
|
|
23292
23296
|
title: "Get Line Movement",
|
|
23293
|
-
description: "Get
|
|
23297
|
+
description: "Get odds history and line movement for a single game.",
|
|
23294
23298
|
inputSchema: {
|
|
23295
23299
|
sport: SportSchema4.describe("Sport code. Only nba is currently supported."),
|
|
23296
23300
|
game_id: string2().describe("Game ID such as 20260308_1310_NBA_BOS_CLE."),
|
|
@@ -23314,6 +23318,136 @@ function registerOddsTools(server, api2) {
|
|
|
23314
23318
|
});
|
|
23315
23319
|
}
|
|
23316
23320
|
|
|
23321
|
+
// src/tools/sports.ts
|
|
23322
|
+
function registerSportTools(server, api2) {
|
|
23323
|
+
server.registerTool("get_sports", {
|
|
23324
|
+
title: "Get Sports",
|
|
23325
|
+
description: "List supported sports, API-key access, and canonical endpoint templates.",
|
|
23326
|
+
inputSchema: {},
|
|
23327
|
+
annotations: {
|
|
23328
|
+
readOnlyHint: true,
|
|
23329
|
+
openWorldHint: true
|
|
23330
|
+
}
|
|
23331
|
+
}, async () => {
|
|
23332
|
+
try {
|
|
23333
|
+
const payload = await api2.get("/v1/sports");
|
|
23334
|
+
return successToolResult(payload);
|
|
23335
|
+
} catch (error2) {
|
|
23336
|
+
return errorToolResult(error2);
|
|
23337
|
+
}
|
|
23338
|
+
});
|
|
23339
|
+
}
|
|
23340
|
+
|
|
23341
|
+
// src/tools/teams.ts
|
|
23342
|
+
var SportSchema5 = _enum(["nba"]).default("nba");
|
|
23343
|
+
var GameStatusSchema2 = _enum(["scheduled", "live", "final"]);
|
|
23344
|
+
var PaginationLimitSchema3 = number2().int().min(1).max(100).optional();
|
|
23345
|
+
var PaginationOffsetSchema3 = number2().int().min(0).optional();
|
|
23346
|
+
function registerTeamTools(server, api2) {
|
|
23347
|
+
server.registerTool("get_teams", {
|
|
23348
|
+
title: "Get Teams",
|
|
23349
|
+
description: "List teams for a sport with optional active, conference, and search filters.",
|
|
23350
|
+
inputSchema: {
|
|
23351
|
+
sport: SportSchema5.describe("Sport code. Only nba is currently supported."),
|
|
23352
|
+
active: boolean2().optional().describe("Filter to active teams only when true, inactive only when false."),
|
|
23353
|
+
conference: string2().optional().describe("Optional conference filter such as Eastern or Western."),
|
|
23354
|
+
search: string2().optional().describe("Case-insensitive search across team code, city, and name."),
|
|
23355
|
+
include_assets: boolean2().optional().describe("Include team asset metadata such as logos when true."),
|
|
23356
|
+
limit: PaginationLimitSchema3.describe("Number of teams to return. Max 100."),
|
|
23357
|
+
offset: PaginationOffsetSchema3.describe("Pagination offset.")
|
|
23358
|
+
},
|
|
23359
|
+
annotations: {
|
|
23360
|
+
readOnlyHint: true,
|
|
23361
|
+
openWorldHint: true
|
|
23362
|
+
}
|
|
23363
|
+
}, async ({ sport, active, conference, search, include_assets, limit, offset }) => {
|
|
23364
|
+
try {
|
|
23365
|
+
const payload = await api2.get(`/v1/${sport}/teams`, {
|
|
23366
|
+
active,
|
|
23367
|
+
conference,
|
|
23368
|
+
search,
|
|
23369
|
+
include: include_assets ? "assets" : undefined,
|
|
23370
|
+
limit,
|
|
23371
|
+
offset
|
|
23372
|
+
});
|
|
23373
|
+
return successToolResult(payload);
|
|
23374
|
+
} catch (error2) {
|
|
23375
|
+
return errorToolResult(error2);
|
|
23376
|
+
}
|
|
23377
|
+
});
|
|
23378
|
+
server.registerTool("get_team", {
|
|
23379
|
+
title: "Get Team",
|
|
23380
|
+
description: "Get a single team by its canonical team code such as BOS or LAL.",
|
|
23381
|
+
inputSchema: {
|
|
23382
|
+
sport: SportSchema5.describe("Sport code. Only nba is currently supported."),
|
|
23383
|
+
team_code: string2().describe("Canonical team code such as BOS, LAL, or CLE."),
|
|
23384
|
+
include_assets: boolean2().optional().describe("Include team asset metadata such as logos when true.")
|
|
23385
|
+
},
|
|
23386
|
+
annotations: {
|
|
23387
|
+
readOnlyHint: true,
|
|
23388
|
+
openWorldHint: true
|
|
23389
|
+
}
|
|
23390
|
+
}, async ({ sport, team_code, include_assets }) => {
|
|
23391
|
+
try {
|
|
23392
|
+
const normalizedCode = team_code.trim().toUpperCase();
|
|
23393
|
+
const payload = await api2.get(`/v1/${sport}/teams/${normalizedCode}`, {
|
|
23394
|
+
include: include_assets ? "assets" : undefined
|
|
23395
|
+
});
|
|
23396
|
+
return successToolResult(payload);
|
|
23397
|
+
} catch (error2) {
|
|
23398
|
+
return errorToolResult(error2);
|
|
23399
|
+
}
|
|
23400
|
+
});
|
|
23401
|
+
server.registerTool("get_team_games", {
|
|
23402
|
+
title: "Get Team Games",
|
|
23403
|
+
description: "Get a normalized team-centric game log with requested-team scores, opponents, results, and optional box score data.",
|
|
23404
|
+
inputSchema: {
|
|
23405
|
+
sport: SportSchema5.describe("Sport code. Only nba is currently supported."),
|
|
23406
|
+
team_code: string2().describe("Canonical team code such as BOS, LAL, or CLE."),
|
|
23407
|
+
date: string2().optional().describe("Exact game date in YYYY-MM-DD format."),
|
|
23408
|
+
date_from: string2().optional().describe("Start date in YYYY-MM-DD format."),
|
|
23409
|
+
date_to: string2().optional().describe("End date in YYYY-MM-DD format."),
|
|
23410
|
+
status: GameStatusSchema2.optional().describe("scheduled, live, or final"),
|
|
23411
|
+
season: string2().optional().describe("Season string such as 2025-26."),
|
|
23412
|
+
include_boxscore: boolean2().optional().describe("Include the requested team box score row for each game when true."),
|
|
23413
|
+
limit: PaginationLimitSchema3.describe("Number of games to return. Max 100."),
|
|
23414
|
+
offset: PaginationOffsetSchema3.describe("Pagination offset.")
|
|
23415
|
+
},
|
|
23416
|
+
annotations: {
|
|
23417
|
+
readOnlyHint: true,
|
|
23418
|
+
openWorldHint: true
|
|
23419
|
+
}
|
|
23420
|
+
}, async ({
|
|
23421
|
+
sport,
|
|
23422
|
+
team_code,
|
|
23423
|
+
date: date5,
|
|
23424
|
+
date_from,
|
|
23425
|
+
date_to,
|
|
23426
|
+
status,
|
|
23427
|
+
season,
|
|
23428
|
+
include_boxscore,
|
|
23429
|
+
limit,
|
|
23430
|
+
offset
|
|
23431
|
+
}) => {
|
|
23432
|
+
try {
|
|
23433
|
+
const normalizedCode = team_code.trim().toUpperCase();
|
|
23434
|
+
const payload = await api2.get(`/v1/${sport}/teams/${normalizedCode}/games`, {
|
|
23435
|
+
date: date5,
|
|
23436
|
+
date_from,
|
|
23437
|
+
date_to,
|
|
23438
|
+
status,
|
|
23439
|
+
season,
|
|
23440
|
+
include: include_boxscore ? "boxscore" : undefined,
|
|
23441
|
+
limit,
|
|
23442
|
+
offset
|
|
23443
|
+
});
|
|
23444
|
+
return successToolResult(payload);
|
|
23445
|
+
} catch (error2) {
|
|
23446
|
+
return errorToolResult(error2);
|
|
23447
|
+
}
|
|
23448
|
+
});
|
|
23449
|
+
}
|
|
23450
|
+
|
|
23317
23451
|
// src/server.ts
|
|
23318
23452
|
function createThesisMcpServer(options) {
|
|
23319
23453
|
const server = new McpServer({
|
|
@@ -23331,6 +23465,8 @@ function createThesisMcpServer(options) {
|
|
|
23331
23465
|
registerBoxscoreTools(server, api2);
|
|
23332
23466
|
registerOddsTools(server, api2);
|
|
23333
23467
|
registerBookmakerTools(server, api2);
|
|
23468
|
+
registerSportTools(server, api2);
|
|
23469
|
+
registerTeamTools(server, api2);
|
|
23334
23470
|
return server;
|
|
23335
23471
|
}
|
|
23336
23472
|
|
package/dist/stdio.js
CHANGED
|
@@ -12459,10 +12459,30 @@ function requireStdioApiKey() {
|
|
|
12459
12459
|
}
|
|
12460
12460
|
|
|
12461
12461
|
// src/lib/config.ts
|
|
12462
|
-
var MCP_VERSION = "0.1.
|
|
12462
|
+
var MCP_VERSION = "0.1.5";
|
|
12463
12463
|
var DEFAULT_API_URL = "https://api.withthesis.dev";
|
|
12464
|
-
function
|
|
12465
|
-
|
|
12464
|
+
function trimEnv(value) {
|
|
12465
|
+
const trimmed = value?.trim();
|
|
12466
|
+
return trimmed ? trimmed : null;
|
|
12467
|
+
}
|
|
12468
|
+
function isLocalhostUrl(value) {
|
|
12469
|
+
try {
|
|
12470
|
+
const url = new URL(value);
|
|
12471
|
+
return url.hostname === "localhost" || url.hostname === "127.0.0.1" || url.hostname === "::1";
|
|
12472
|
+
} catch {
|
|
12473
|
+
return false;
|
|
12474
|
+
}
|
|
12475
|
+
}
|
|
12476
|
+
function resolveStdioApiBaseUrl() {
|
|
12477
|
+
const explicitMcpUrl = trimEnv(process.env.THESIS_MCP_API_URL);
|
|
12478
|
+
if (explicitMcpUrl) {
|
|
12479
|
+
return explicitMcpUrl;
|
|
12480
|
+
}
|
|
12481
|
+
const inheritedApiUrl = trimEnv(process.env.THESIS_API_URL);
|
|
12482
|
+
if (inheritedApiUrl && isLocalhostUrl(inheritedApiUrl)) {
|
|
12483
|
+
return inheritedApiUrl;
|
|
12484
|
+
}
|
|
12485
|
+
return DEFAULT_API_URL;
|
|
12466
12486
|
}
|
|
12467
12487
|
|
|
12468
12488
|
// ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v3/helpers/util.js
|
|
@@ -20038,7 +20058,7 @@ var SportSchema = _enum(["nba"]).default("nba");
|
|
|
20038
20058
|
function registerBookmakerTools(server, api2) {
|
|
20039
20059
|
server.registerTool("get_bookmakers", {
|
|
20040
20060
|
title: "Get Bookmakers",
|
|
20041
|
-
description: "List
|
|
20061
|
+
description: "List bookmakers with sharp, opener, and active filters.",
|
|
20042
20062
|
inputSchema: {
|
|
20043
20063
|
sport: SportSchema.describe("Sport code. Only nba is currently supported."),
|
|
20044
20064
|
sharp: boolean2().optional().describe("Filter to sharp bookmakers only."),
|
|
@@ -20068,7 +20088,7 @@ var SportSchema2 = _enum(["nba"]).default("nba");
|
|
|
20068
20088
|
function registerBoxscoreTools(server, api2) {
|
|
20069
20089
|
server.registerTool("get_boxscore", {
|
|
20070
20090
|
title: "Get Box Score",
|
|
20071
|
-
description: "Get the full team-level box score for a single
|
|
20091
|
+
description: "Get the full team-level box score for a single game.",
|
|
20072
20092
|
inputSchema: {
|
|
20073
20093
|
sport: SportSchema2.describe("Sport code. Only nba is currently supported."),
|
|
20074
20094
|
game_id: string2().describe("Game ID such as 20260308_1310_NBA_BOS_CLE.")
|
|
@@ -20095,7 +20115,7 @@ var PaginationOffsetSchema = number2().int().min(0).optional();
|
|
|
20095
20115
|
function registerGameTools(server, api2) {
|
|
20096
20116
|
server.registerTool("get_games", {
|
|
20097
20117
|
title: "Get Games",
|
|
20098
|
-
description: "
|
|
20118
|
+
description: "List games by date, date range, team, status, or season.",
|
|
20099
20119
|
inputSchema: {
|
|
20100
20120
|
sport: SportSchema3.describe("Sport code. Only nba is currently supported."),
|
|
20101
20121
|
date: string2().optional().describe("Game date in YYYY-MM-DD format."),
|
|
@@ -20130,7 +20150,7 @@ function registerGameTools(server, api2) {
|
|
|
20130
20150
|
});
|
|
20131
20151
|
server.registerTool("get_game", {
|
|
20132
20152
|
title: "Get Game",
|
|
20133
|
-
description: "Get a single
|
|
20153
|
+
description: "Get a single game with scores, officials, and partial box score details.",
|
|
20134
20154
|
inputSchema: {
|
|
20135
20155
|
sport: SportSchema3.describe("Sport code. Only nba is currently supported."),
|
|
20136
20156
|
game_id: string2().describe("Game ID such as 20260308_1310_NBA_BOS_CLE.")
|
|
@@ -20157,10 +20177,10 @@ var PaginationOffsetSchema2 = number2().int().min(0).optional();
|
|
|
20157
20177
|
function registerOddsTools(server, api2) {
|
|
20158
20178
|
server.registerTool("get_odds", {
|
|
20159
20179
|
title: "Get Odds",
|
|
20160
|
-
description: "Get current
|
|
20180
|
+
description: "Get current odds snapshots by game, date, bookmaker, sharp books, opener books, or line type.",
|
|
20161
20181
|
inputSchema: {
|
|
20162
20182
|
sport: SportSchema4.describe("Sport code. Only nba is currently supported."),
|
|
20163
|
-
game_id: string2().optional().describe("Filter to a specific
|
|
20183
|
+
game_id: string2().optional().describe("Filter to a specific game ID."),
|
|
20164
20184
|
date: string2().optional().describe("Game date in YYYY-MM-DD format."),
|
|
20165
20185
|
bookmaker: string2().optional().describe("Comma-separated bookmaker codes such as circa,dk."),
|
|
20166
20186
|
sharp: boolean2().optional().describe("Filter to sharp bookmakers only."),
|
|
@@ -20192,7 +20212,7 @@ function registerOddsTools(server, api2) {
|
|
|
20192
20212
|
});
|
|
20193
20213
|
server.registerTool("get_line_movement", {
|
|
20194
20214
|
title: "Get Line Movement",
|
|
20195
|
-
description: "Get
|
|
20215
|
+
description: "Get odds history and line movement for a single game.",
|
|
20196
20216
|
inputSchema: {
|
|
20197
20217
|
sport: SportSchema4.describe("Sport code. Only nba is currently supported."),
|
|
20198
20218
|
game_id: string2().describe("Game ID such as 20260308_1310_NBA_BOS_CLE."),
|
|
@@ -20216,6 +20236,136 @@ function registerOddsTools(server, api2) {
|
|
|
20216
20236
|
});
|
|
20217
20237
|
}
|
|
20218
20238
|
|
|
20239
|
+
// src/tools/sports.ts
|
|
20240
|
+
function registerSportTools(server, api2) {
|
|
20241
|
+
server.registerTool("get_sports", {
|
|
20242
|
+
title: "Get Sports",
|
|
20243
|
+
description: "List supported sports, API-key access, and canonical endpoint templates.",
|
|
20244
|
+
inputSchema: {},
|
|
20245
|
+
annotations: {
|
|
20246
|
+
readOnlyHint: true,
|
|
20247
|
+
openWorldHint: true
|
|
20248
|
+
}
|
|
20249
|
+
}, async () => {
|
|
20250
|
+
try {
|
|
20251
|
+
const payload = await api2.get("/v1/sports");
|
|
20252
|
+
return successToolResult(payload);
|
|
20253
|
+
} catch (error2) {
|
|
20254
|
+
return errorToolResult(error2);
|
|
20255
|
+
}
|
|
20256
|
+
});
|
|
20257
|
+
}
|
|
20258
|
+
|
|
20259
|
+
// src/tools/teams.ts
|
|
20260
|
+
var SportSchema5 = _enum(["nba"]).default("nba");
|
|
20261
|
+
var GameStatusSchema2 = _enum(["scheduled", "live", "final"]);
|
|
20262
|
+
var PaginationLimitSchema3 = number2().int().min(1).max(100).optional();
|
|
20263
|
+
var PaginationOffsetSchema3 = number2().int().min(0).optional();
|
|
20264
|
+
function registerTeamTools(server, api2) {
|
|
20265
|
+
server.registerTool("get_teams", {
|
|
20266
|
+
title: "Get Teams",
|
|
20267
|
+
description: "List teams for a sport with optional active, conference, and search filters.",
|
|
20268
|
+
inputSchema: {
|
|
20269
|
+
sport: SportSchema5.describe("Sport code. Only nba is currently supported."),
|
|
20270
|
+
active: boolean2().optional().describe("Filter to active teams only when true, inactive only when false."),
|
|
20271
|
+
conference: string2().optional().describe("Optional conference filter such as Eastern or Western."),
|
|
20272
|
+
search: string2().optional().describe("Case-insensitive search across team code, city, and name."),
|
|
20273
|
+
include_assets: boolean2().optional().describe("Include team asset metadata such as logos when true."),
|
|
20274
|
+
limit: PaginationLimitSchema3.describe("Number of teams to return. Max 100."),
|
|
20275
|
+
offset: PaginationOffsetSchema3.describe("Pagination offset.")
|
|
20276
|
+
},
|
|
20277
|
+
annotations: {
|
|
20278
|
+
readOnlyHint: true,
|
|
20279
|
+
openWorldHint: true
|
|
20280
|
+
}
|
|
20281
|
+
}, async ({ sport, active, conference, search, include_assets, limit, offset }) => {
|
|
20282
|
+
try {
|
|
20283
|
+
const payload = await api2.get(`/v1/${sport}/teams`, {
|
|
20284
|
+
active,
|
|
20285
|
+
conference,
|
|
20286
|
+
search,
|
|
20287
|
+
include: include_assets ? "assets" : undefined,
|
|
20288
|
+
limit,
|
|
20289
|
+
offset
|
|
20290
|
+
});
|
|
20291
|
+
return successToolResult(payload);
|
|
20292
|
+
} catch (error2) {
|
|
20293
|
+
return errorToolResult(error2);
|
|
20294
|
+
}
|
|
20295
|
+
});
|
|
20296
|
+
server.registerTool("get_team", {
|
|
20297
|
+
title: "Get Team",
|
|
20298
|
+
description: "Get a single team by its canonical team code such as BOS or LAL.",
|
|
20299
|
+
inputSchema: {
|
|
20300
|
+
sport: SportSchema5.describe("Sport code. Only nba is currently supported."),
|
|
20301
|
+
team_code: string2().describe("Canonical team code such as BOS, LAL, or CLE."),
|
|
20302
|
+
include_assets: boolean2().optional().describe("Include team asset metadata such as logos when true.")
|
|
20303
|
+
},
|
|
20304
|
+
annotations: {
|
|
20305
|
+
readOnlyHint: true,
|
|
20306
|
+
openWorldHint: true
|
|
20307
|
+
}
|
|
20308
|
+
}, async ({ sport, team_code, include_assets }) => {
|
|
20309
|
+
try {
|
|
20310
|
+
const normalizedCode = team_code.trim().toUpperCase();
|
|
20311
|
+
const payload = await api2.get(`/v1/${sport}/teams/${normalizedCode}`, {
|
|
20312
|
+
include: include_assets ? "assets" : undefined
|
|
20313
|
+
});
|
|
20314
|
+
return successToolResult(payload);
|
|
20315
|
+
} catch (error2) {
|
|
20316
|
+
return errorToolResult(error2);
|
|
20317
|
+
}
|
|
20318
|
+
});
|
|
20319
|
+
server.registerTool("get_team_games", {
|
|
20320
|
+
title: "Get Team Games",
|
|
20321
|
+
description: "Get a normalized team-centric game log with requested-team scores, opponents, results, and optional box score data.",
|
|
20322
|
+
inputSchema: {
|
|
20323
|
+
sport: SportSchema5.describe("Sport code. Only nba is currently supported."),
|
|
20324
|
+
team_code: string2().describe("Canonical team code such as BOS, LAL, or CLE."),
|
|
20325
|
+
date: string2().optional().describe("Exact game date in YYYY-MM-DD format."),
|
|
20326
|
+
date_from: string2().optional().describe("Start date in YYYY-MM-DD format."),
|
|
20327
|
+
date_to: string2().optional().describe("End date in YYYY-MM-DD format."),
|
|
20328
|
+
status: GameStatusSchema2.optional().describe("scheduled, live, or final"),
|
|
20329
|
+
season: string2().optional().describe("Season string such as 2025-26."),
|
|
20330
|
+
include_boxscore: boolean2().optional().describe("Include the requested team box score row for each game when true."),
|
|
20331
|
+
limit: PaginationLimitSchema3.describe("Number of games to return. Max 100."),
|
|
20332
|
+
offset: PaginationOffsetSchema3.describe("Pagination offset.")
|
|
20333
|
+
},
|
|
20334
|
+
annotations: {
|
|
20335
|
+
readOnlyHint: true,
|
|
20336
|
+
openWorldHint: true
|
|
20337
|
+
}
|
|
20338
|
+
}, async ({
|
|
20339
|
+
sport,
|
|
20340
|
+
team_code,
|
|
20341
|
+
date: date4,
|
|
20342
|
+
date_from,
|
|
20343
|
+
date_to,
|
|
20344
|
+
status,
|
|
20345
|
+
season,
|
|
20346
|
+
include_boxscore,
|
|
20347
|
+
limit,
|
|
20348
|
+
offset
|
|
20349
|
+
}) => {
|
|
20350
|
+
try {
|
|
20351
|
+
const normalizedCode = team_code.trim().toUpperCase();
|
|
20352
|
+
const payload = await api2.get(`/v1/${sport}/teams/${normalizedCode}/games`, {
|
|
20353
|
+
date: date4,
|
|
20354
|
+
date_from,
|
|
20355
|
+
date_to,
|
|
20356
|
+
status,
|
|
20357
|
+
season,
|
|
20358
|
+
include: include_boxscore ? "boxscore" : undefined,
|
|
20359
|
+
limit,
|
|
20360
|
+
offset
|
|
20361
|
+
});
|
|
20362
|
+
return successToolResult(payload);
|
|
20363
|
+
} catch (error2) {
|
|
20364
|
+
return errorToolResult(error2);
|
|
20365
|
+
}
|
|
20366
|
+
});
|
|
20367
|
+
}
|
|
20368
|
+
|
|
20219
20369
|
// src/server.ts
|
|
20220
20370
|
function createThesisMcpServer(options) {
|
|
20221
20371
|
const server = new McpServer({
|
|
@@ -20233,6 +20383,8 @@ function createThesisMcpServer(options) {
|
|
|
20233
20383
|
registerBoxscoreTools(server, api2);
|
|
20234
20384
|
registerOddsTools(server, api2);
|
|
20235
20385
|
registerBookmakerTools(server, api2);
|
|
20386
|
+
registerSportTools(server, api2);
|
|
20387
|
+
registerTeamTools(server, api2);
|
|
20236
20388
|
return server;
|
|
20237
20389
|
}
|
|
20238
20390
|
|
|
@@ -20240,7 +20392,7 @@ function createThesisMcpServer(options) {
|
|
|
20240
20392
|
async function startStdioServer() {
|
|
20241
20393
|
const apiKey = requireStdioApiKey();
|
|
20242
20394
|
const server = createThesisMcpServer({
|
|
20243
|
-
apiBaseUrl:
|
|
20395
|
+
apiBaseUrl: resolveStdioApiBaseUrl(),
|
|
20244
20396
|
apiKey,
|
|
20245
20397
|
clientName: "local-stdio"
|
|
20246
20398
|
});
|