@pipeworx/mcp-tvmaze 0.1.0
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 +56 -0
- package/package.json +20 -0
- package/server.json +18 -0
- package/src/index.ts +353 -0
- package/tsconfig.json +14 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Pipeworx
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# mcp-tvmaze
|
|
2
|
+
|
|
3
|
+
TVMaze MCP — TV show metadata, episodes, schedules (no auth)
|
|
4
|
+
|
|
5
|
+
Part of [Pipeworx](https://pipeworx.io) — an MCP gateway connecting AI agents to 250+ live data sources.
|
|
6
|
+
|
|
7
|
+
## Tools
|
|
8
|
+
|
|
9
|
+
| Tool | Description |
|
|
10
|
+
|------|-------------|
|
|
11
|
+
| `search_people` | Search actors / people by name. Returns id, name, country, birthday, gender, image. |
|
|
12
|
+
|
|
13
|
+
## Quick Start
|
|
14
|
+
|
|
15
|
+
Add to your MCP client (Claude Desktop, Cursor, Windsurf, etc.):
|
|
16
|
+
|
|
17
|
+
```json
|
|
18
|
+
{
|
|
19
|
+
"mcpServers": {
|
|
20
|
+
"tvmaze": {
|
|
21
|
+
"url": "https://gateway.pipeworx.io/tvmaze/mcp"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Or connect to the full Pipeworx gateway for access to all 250+ data sources:
|
|
28
|
+
|
|
29
|
+
```json
|
|
30
|
+
{
|
|
31
|
+
"mcpServers": {
|
|
32
|
+
"pipeworx": {
|
|
33
|
+
"url": "https://gateway.pipeworx.io/mcp"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Using with ask_pipeworx
|
|
40
|
+
|
|
41
|
+
Instead of calling tools directly, you can ask questions in plain English:
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
ask_pipeworx({ question: "your question about Tvmaze data" })
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
The gateway picks the right tool and fills the arguments automatically.
|
|
48
|
+
|
|
49
|
+
## More
|
|
50
|
+
|
|
51
|
+
- [All tools and guides](https://github.com/pipeworx-io/examples)
|
|
52
|
+
- [pipeworx.io](https://pipeworx.io)
|
|
53
|
+
|
|
54
|
+
## License
|
|
55
|
+
|
|
56
|
+
MIT
|
package/package.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@pipeworx/mcp-tvmaze",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "TVMaze MCP — TV show metadata, episodes, schedules (no auth)",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "src/index.ts",
|
|
7
|
+
"types": "src/index.ts",
|
|
8
|
+
"keywords": ["mcp", "mcp-server", "model-context-protocol", "pipeworx", "tvmaze"],
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "https://github.com/pipeworx-io/mcp-tvmaze"
|
|
13
|
+
},
|
|
14
|
+
"scripts": {
|
|
15
|
+
"typecheck": "tsc --noEmit"
|
|
16
|
+
},
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"typescript": "^5.7.0"
|
|
19
|
+
}
|
|
20
|
+
}
|
package/server.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
|
|
3
|
+
"name": "io.github.pipeworx-io/tvmaze",
|
|
4
|
+
"title": "Tvmaze",
|
|
5
|
+
"description": "TVMaze MCP — TV show metadata, episodes, schedules (no auth)",
|
|
6
|
+
"version": "0.1.0",
|
|
7
|
+
"websiteUrl": "https://pipeworx.io/packs/tvmaze",
|
|
8
|
+
"repository": {
|
|
9
|
+
"url": "https://github.com/pipeworx-io/mcp-tvmaze",
|
|
10
|
+
"source": "github"
|
|
11
|
+
},
|
|
12
|
+
"remotes": [
|
|
13
|
+
{
|
|
14
|
+
"type": "streamable-http",
|
|
15
|
+
"url": "https://gateway.pipeworx.io/tvmaze/mcp"
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
interface McpToolDefinition {
|
|
2
|
+
name: string;
|
|
3
|
+
description: string;
|
|
4
|
+
inputSchema: {
|
|
5
|
+
type: 'object';
|
|
6
|
+
properties: Record<string, unknown>;
|
|
7
|
+
required?: string[];
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
interface McpToolExport {
|
|
12
|
+
tools: McpToolDefinition[];
|
|
13
|
+
callTool: (name: string, args: Record<string, unknown>) => Promise<unknown>;
|
|
14
|
+
meter?: { credits: number };
|
|
15
|
+
cost?: Record<string, unknown>;
|
|
16
|
+
provider?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* TVMaze MCP — TV show metadata, episodes, schedules (no auth)
|
|
21
|
+
*
|
|
22
|
+
* Complements the `movies` pack (film-only). TVMaze covers air dates, network/
|
|
23
|
+
* web-channel data, cast, and per-episode info that TMDB doesn't surface
|
|
24
|
+
* cleanly.
|
|
25
|
+
*
|
|
26
|
+
* API: https://www.tvmaze.com/api
|
|
27
|
+
* Tools:
|
|
28
|
+
* - search_shows: text search
|
|
29
|
+
* - get_show: full show record with optional embeds (episodes, cast, seasons)
|
|
30
|
+
* - list_episodes: episode list for a show
|
|
31
|
+
* - get_schedule: what's airing on a given day in a country
|
|
32
|
+
* - search_people: actor / person search
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
const BASE_URL = 'https://api.tvmaze.com';
|
|
37
|
+
|
|
38
|
+
const tools: McpToolExport['tools'] = [
|
|
39
|
+
{
|
|
40
|
+
name: 'search_shows',
|
|
41
|
+
description:
|
|
42
|
+
'Search TV shows by name. Returns shows with id, name, premiere date, network, genres, rating, status, and TVMaze URL.',
|
|
43
|
+
inputSchema: {
|
|
44
|
+
type: 'object',
|
|
45
|
+
properties: {
|
|
46
|
+
query: { type: 'string', description: 'Show name (full or partial)' },
|
|
47
|
+
},
|
|
48
|
+
required: ['query'],
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: 'get_show',
|
|
53
|
+
description:
|
|
54
|
+
'Fetch a full show record by TVMaze ID. Optionally embed episodes, cast, seasons, or previous/next episode info for richer responses.',
|
|
55
|
+
inputSchema: {
|
|
56
|
+
type: 'object',
|
|
57
|
+
properties: {
|
|
58
|
+
show_id: { type: 'number', description: 'TVMaze show ID' },
|
|
59
|
+
embed_episodes: { type: 'boolean', description: 'Include full episode list' },
|
|
60
|
+
embed_cast: { type: 'boolean', description: 'Include cast' },
|
|
61
|
+
embed_seasons: { type: 'boolean', description: 'Include season metadata' },
|
|
62
|
+
},
|
|
63
|
+
required: ['show_id'],
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
name: 'list_episodes',
|
|
68
|
+
description:
|
|
69
|
+
'List all episodes of a show. Returns season, number, name, airdate, runtime, and summary.',
|
|
70
|
+
inputSchema: {
|
|
71
|
+
type: 'object',
|
|
72
|
+
properties: {
|
|
73
|
+
show_id: { type: 'number', description: 'TVMaze show ID' },
|
|
74
|
+
specials: { type: 'boolean', description: 'Include special episodes (default false)' },
|
|
75
|
+
},
|
|
76
|
+
required: ['show_id'],
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
name: 'get_schedule',
|
|
81
|
+
description:
|
|
82
|
+
'What TV shows are airing on a given day in a country. Useful for "what aired last night on UK TV". Returns episode + show records.',
|
|
83
|
+
inputSchema: {
|
|
84
|
+
type: 'object',
|
|
85
|
+
properties: {
|
|
86
|
+
country: { type: 'string', description: '2-letter country code (default "US")' },
|
|
87
|
+
date: { type: 'string', description: 'YYYY-MM-DD (default today)' },
|
|
88
|
+
},
|
|
89
|
+
required: [],
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
name: 'search_people',
|
|
94
|
+
description: 'Search actors / people by name. Returns id, name, country, birthday, gender, image.',
|
|
95
|
+
inputSchema: {
|
|
96
|
+
type: 'object',
|
|
97
|
+
properties: {
|
|
98
|
+
query: { type: 'string', description: 'Person name' },
|
|
99
|
+
},
|
|
100
|
+
required: ['query'],
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
];
|
|
104
|
+
|
|
105
|
+
async function callTool(name: string, args: Record<string, unknown>): Promise<unknown> {
|
|
106
|
+
switch (name) {
|
|
107
|
+
case 'search_shows':
|
|
108
|
+
return searchShows(reqStr(args, 'query', '"the wire"'));
|
|
109
|
+
case 'get_show':
|
|
110
|
+
return getShow(args);
|
|
111
|
+
case 'list_episodes':
|
|
112
|
+
return listEpisodes(args);
|
|
113
|
+
case 'get_schedule':
|
|
114
|
+
return getSchedule(args);
|
|
115
|
+
case 'search_people':
|
|
116
|
+
return searchPeople(reqStr(args, 'query', '"bryan cranston"'));
|
|
117
|
+
default:
|
|
118
|
+
throw new Error(`Unknown tool: ${name}`);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
function reqStr(args: Record<string, unknown>, key: string, example: string): string {
|
|
123
|
+
const v = args[key];
|
|
124
|
+
if (typeof v !== 'string' || !v.trim()) {
|
|
125
|
+
throw new Error(`Required argument "${key}" is missing or empty. Pass a string like ${example}.`);
|
|
126
|
+
}
|
|
127
|
+
return v;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
async function tvmFetch<T>(path: string): Promise<T> {
|
|
131
|
+
const res = await fetch(`${BASE_URL}${path}`);
|
|
132
|
+
if (res.status === 404) throw new Error('TVMaze: not found (HTTP 404)');
|
|
133
|
+
if (res.status === 429) throw new Error('TVMaze: rate-limit (HTTP 429)');
|
|
134
|
+
if (!res.ok) {
|
|
135
|
+
const body = await res.text();
|
|
136
|
+
throw new Error(`TVMaze error: ${res.status} ${body.slice(0, 200)}`);
|
|
137
|
+
}
|
|
138
|
+
return res.json() as Promise<T>;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
function stripHtml(s?: string | null): string | null {
|
|
142
|
+
if (!s) return null;
|
|
143
|
+
return s.replace(/<[^>]+>/g, '').replace(/&/g, '&').replace(/ /g, ' ').trim();
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
interface TvmShow {
|
|
147
|
+
id?: number;
|
|
148
|
+
url?: string;
|
|
149
|
+
name?: string;
|
|
150
|
+
type?: string;
|
|
151
|
+
language?: string;
|
|
152
|
+
genres?: string[];
|
|
153
|
+
status?: string;
|
|
154
|
+
runtime?: number;
|
|
155
|
+
averageRuntime?: number;
|
|
156
|
+
premiered?: string;
|
|
157
|
+
ended?: string | null;
|
|
158
|
+
officialSite?: string | null;
|
|
159
|
+
rating?: { average?: number | null };
|
|
160
|
+
network?: { name?: string; country?: { code?: string; name?: string } } | null;
|
|
161
|
+
webChannel?: { name?: string; country?: { code?: string; name?: string } | null } | null;
|
|
162
|
+
externals?: { tvrage?: number | null; thetvdb?: number | null; imdb?: string | null };
|
|
163
|
+
image?: { medium?: string; original?: string };
|
|
164
|
+
summary?: string;
|
|
165
|
+
_embedded?: {
|
|
166
|
+
episodes?: TvmEpisode[];
|
|
167
|
+
cast?: TvmCast[];
|
|
168
|
+
seasons?: TvmSeason[];
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
interface TvmEpisode {
|
|
173
|
+
id?: number;
|
|
174
|
+
url?: string;
|
|
175
|
+
name?: string;
|
|
176
|
+
season?: number;
|
|
177
|
+
number?: number;
|
|
178
|
+
type?: string;
|
|
179
|
+
airdate?: string;
|
|
180
|
+
airtime?: string;
|
|
181
|
+
runtime?: number;
|
|
182
|
+
rating?: { average?: number | null };
|
|
183
|
+
summary?: string;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
interface TvmCast {
|
|
187
|
+
person?: { id?: number; name?: string; image?: { medium?: string; original?: string } | null };
|
|
188
|
+
character?: { id?: number; name?: string };
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
interface TvmSeason {
|
|
192
|
+
id?: number;
|
|
193
|
+
number?: number;
|
|
194
|
+
episodeOrder?: number;
|
|
195
|
+
premiereDate?: string;
|
|
196
|
+
endDate?: string;
|
|
197
|
+
network?: { name?: string } | null;
|
|
198
|
+
summary?: string;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
function normalizeShow(s: TvmShow) {
|
|
202
|
+
return {
|
|
203
|
+
id: s.id ?? null,
|
|
204
|
+
name: s.name ?? null,
|
|
205
|
+
type: s.type ?? null,
|
|
206
|
+
language: s.language ?? null,
|
|
207
|
+
genres: s.genres ?? [],
|
|
208
|
+
status: s.status ?? null,
|
|
209
|
+
runtime_min: s.runtime ?? s.averageRuntime ?? null,
|
|
210
|
+
premiered: s.premiered ?? null,
|
|
211
|
+
ended: s.ended ?? null,
|
|
212
|
+
official_site: s.officialSite ?? null,
|
|
213
|
+
rating: s.rating?.average ?? null,
|
|
214
|
+
network: s.network?.name ?? s.webChannel?.name ?? null,
|
|
215
|
+
network_country: s.network?.country?.code ?? s.webChannel?.country?.code ?? null,
|
|
216
|
+
imdb_id: s.externals?.imdb ?? null,
|
|
217
|
+
tvdb_id: s.externals?.thetvdb ?? null,
|
|
218
|
+
image: s.image?.original ?? s.image?.medium ?? null,
|
|
219
|
+
summary: stripHtml(s.summary),
|
|
220
|
+
tvmaze_url: s.url ?? null,
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
function normalizeEpisode(e: TvmEpisode) {
|
|
225
|
+
return {
|
|
226
|
+
id: e.id ?? null,
|
|
227
|
+
season: e.season ?? null,
|
|
228
|
+
number: e.number ?? null,
|
|
229
|
+
name: e.name ?? null,
|
|
230
|
+
type: e.type ?? null,
|
|
231
|
+
airdate: e.airdate ?? null,
|
|
232
|
+
airtime: e.airtime ?? null,
|
|
233
|
+
runtime_min: e.runtime ?? null,
|
|
234
|
+
rating: e.rating?.average ?? null,
|
|
235
|
+
summary: stripHtml(e.summary),
|
|
236
|
+
tvmaze_url: e.url ?? null,
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
async function searchShows(query: string) {
|
|
241
|
+
const data = await tvmFetch<{ score?: number; show?: TvmShow }[]>(
|
|
242
|
+
`/search/shows?q=${encodeURIComponent(query)}`,
|
|
243
|
+
);
|
|
244
|
+
return {
|
|
245
|
+
query,
|
|
246
|
+
count: data.length,
|
|
247
|
+
results: data.map((r) => ({
|
|
248
|
+
score: r.score ?? null,
|
|
249
|
+
...normalizeShow(r.show ?? {}),
|
|
250
|
+
})),
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
async function getShow(args: Record<string, unknown>) {
|
|
255
|
+
const id = args.show_id as number;
|
|
256
|
+
if (!id) throw new Error('show_id is required');
|
|
257
|
+
const embed: string[] = [];
|
|
258
|
+
if (args.embed_episodes) embed.push('episodes');
|
|
259
|
+
if (args.embed_cast) embed.push('cast');
|
|
260
|
+
if (args.embed_seasons) embed.push('seasons');
|
|
261
|
+
const qs = embed.length ? `?embed[]=${embed.join('&embed[]=')}` : '';
|
|
262
|
+
const data = await tvmFetch<TvmShow>(`/shows/${id}${qs}`);
|
|
263
|
+
|
|
264
|
+
const out: Record<string, unknown> = normalizeShow(data);
|
|
265
|
+
if (data._embedded?.episodes) {
|
|
266
|
+
out.episodes = data._embedded.episodes.map(normalizeEpisode);
|
|
267
|
+
}
|
|
268
|
+
if (data._embedded?.cast) {
|
|
269
|
+
out.cast = data._embedded.cast.map((c) => ({
|
|
270
|
+
person_id: c.person?.id ?? null,
|
|
271
|
+
person_name: c.person?.name ?? null,
|
|
272
|
+
character_id: c.character?.id ?? null,
|
|
273
|
+
character_name: c.character?.name ?? null,
|
|
274
|
+
image: c.person?.image?.medium ?? null,
|
|
275
|
+
}));
|
|
276
|
+
}
|
|
277
|
+
if (data._embedded?.seasons) {
|
|
278
|
+
out.seasons = data._embedded.seasons.map((s) => ({
|
|
279
|
+
id: s.id ?? null,
|
|
280
|
+
number: s.number ?? null,
|
|
281
|
+
episode_order: s.episodeOrder ?? null,
|
|
282
|
+
premiere_date: s.premiereDate ?? null,
|
|
283
|
+
end_date: s.endDate ?? null,
|
|
284
|
+
network: s.network?.name ?? null,
|
|
285
|
+
summary: stripHtml(s.summary),
|
|
286
|
+
}));
|
|
287
|
+
}
|
|
288
|
+
return out;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
async function listEpisodes(args: Record<string, unknown>) {
|
|
292
|
+
const id = args.show_id as number;
|
|
293
|
+
if (!id) throw new Error('show_id is required');
|
|
294
|
+
const specials = args.specials ? '?specials=1' : '';
|
|
295
|
+
const data = await tvmFetch<TvmEpisode[]>(`/shows/${id}/episodes${specials}`);
|
|
296
|
+
return {
|
|
297
|
+
show_id: id,
|
|
298
|
+
count: data.length,
|
|
299
|
+
episodes: data.map(normalizeEpisode),
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
async function getSchedule(args: Record<string, unknown>) {
|
|
304
|
+
const country = (args.country as string) ?? 'US';
|
|
305
|
+
const date = args.date as string | undefined;
|
|
306
|
+
const params = new URLSearchParams({ country });
|
|
307
|
+
if (date) params.set('date', date);
|
|
308
|
+
|
|
309
|
+
const data = await tvmFetch<(TvmEpisode & { show?: TvmShow })[]>(`/schedule?${params}`);
|
|
310
|
+
return {
|
|
311
|
+
country,
|
|
312
|
+
date: date ?? 'today',
|
|
313
|
+
count: data.length,
|
|
314
|
+
airings: data.map((e) => ({
|
|
315
|
+
...normalizeEpisode(e),
|
|
316
|
+
show: e.show ? normalizeShow(e.show) : null,
|
|
317
|
+
})),
|
|
318
|
+
};
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
interface TvmPerson {
|
|
322
|
+
id?: number;
|
|
323
|
+
name?: string;
|
|
324
|
+
country?: { name?: string; code?: string } | null;
|
|
325
|
+
birthday?: string | null;
|
|
326
|
+
deathday?: string | null;
|
|
327
|
+
gender?: string | null;
|
|
328
|
+
image?: { medium?: string; original?: string } | null;
|
|
329
|
+
url?: string;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
async function searchPeople(query: string) {
|
|
333
|
+
const data = await tvmFetch<{ score?: number; person?: TvmPerson }[]>(
|
|
334
|
+
`/search/people?q=${encodeURIComponent(query)}`,
|
|
335
|
+
);
|
|
336
|
+
return {
|
|
337
|
+
query,
|
|
338
|
+
count: data.length,
|
|
339
|
+
results: data.map((r) => ({
|
|
340
|
+
score: r.score ?? null,
|
|
341
|
+
id: r.person?.id ?? null,
|
|
342
|
+
name: r.person?.name ?? null,
|
|
343
|
+
country: r.person?.country?.code ?? null,
|
|
344
|
+
birthday: r.person?.birthday ?? null,
|
|
345
|
+
deathday: r.person?.deathday ?? null,
|
|
346
|
+
gender: r.person?.gender ?? null,
|
|
347
|
+
image: r.person?.image?.medium ?? null,
|
|
348
|
+
tvmaze_url: r.person?.url ?? null,
|
|
349
|
+
})),
|
|
350
|
+
};
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
export default { tools, callTool, meter: { credits: 1 } } satisfies McpToolExport;
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "bundler",
|
|
6
|
+
"strict": true,
|
|
7
|
+
"esModuleInterop": true,
|
|
8
|
+
"skipLibCheck": true,
|
|
9
|
+
"outDir": "dist",
|
|
10
|
+
"rootDir": "src",
|
|
11
|
+
"declaration": true
|
|
12
|
+
},
|
|
13
|
+
"include": ["src"]
|
|
14
|
+
}
|