fastmcp 4.23.4 → 4.23.5

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.
@@ -9,19 +9,24 @@ import {
9
9
  import { Server } from "@modelcontextprotocol/sdk/server/index.js";
10
10
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
11
11
  import {
12
+ AudioContentSchema,
12
13
  CallToolRequestSchema,
13
14
  CompleteRequestSchema,
15
+ EmbeddedResourceSchema,
14
16
  ErrorCode,
15
17
  GetPromptRequestSchema,
18
+ ImageContentSchema,
16
19
  ListPromptsRequestSchema,
17
20
  ListResourcesRequestSchema,
18
21
  ListResourceTemplatesRequestSchema,
19
22
  ListToolsRequestSchema,
20
23
  McpError,
21
24
  ReadResourceRequestSchema,
25
+ ResourceLinkSchema,
22
26
  RootsListChangedNotificationSchema,
23
27
  SetLevelRequestSchema,
24
28
  SubscribeRequestSchema,
29
+ TextContentSchema,
25
30
  UnsubscribeRequestSchema
26
31
  } from "@modelcontextprotocol/sdk/types.js";
27
32
  import { EventEmitter } from "events";
@@ -381,55 +386,20 @@ function assertToolSchemas(tool) {
381
386
  }
382
387
  var STREAM_KEEPALIVE_LOGGER = "fastmcp-keepalive";
383
388
  var STREAM_KEEPALIVE_DEFAULT_INTERVAL_MS = 2e4;
384
- var TextContentZodSchema = z.object({
385
- /**
386
- * The text content of the message.
387
- */
388
- text: z.string(),
389
- type: z.literal("text")
389
+ var TextContentZodSchema = TextContentSchema.strict();
390
+ var ImageContentZodSchema = ImageContentSchema.extend({
391
+ data: z.string().base64()
390
392
  }).strict();
391
- var ImageContentZodSchema = z.object({
392
- /**
393
- * The base64-encoded image data.
394
- */
395
- data: z.string().base64(),
396
- /**
397
- * The MIME type of the image. Different providers may support different image types.
398
- */
399
- mimeType: z.string(),
400
- type: z.literal("image")
393
+ var AudioContentZodSchema = AudioContentSchema.extend({
394
+ data: z.string().base64()
401
395
  }).strict();
402
- var AudioContentZodSchema = z.object({
403
- /**
404
- * The base64-encoded audio data.
405
- */
406
- data: z.string().base64(),
407
- mimeType: z.string(),
408
- type: z.literal("audio")
409
- }).strict();
410
- var ResourceContentZodSchema = z.object({
411
- resource: z.object({
412
- blob: z.string().optional(),
413
- mimeType: z.string().optional(),
414
- text: z.string().optional(),
415
- uri: z.string()
416
- }),
417
- type: z.literal("resource")
418
- }).strict();
419
- var ResourceLinkZodSchema = z.object({
420
- description: z.string().optional(),
421
- mimeType: z.string().optional(),
422
- name: z.string(),
423
- title: z.string().optional(),
424
- type: z.literal("resource_link"),
425
- uri: z.string()
426
- });
396
+ var ResourceContentZodSchema = EmbeddedResourceSchema.strict();
427
397
  var ContentZodSchema = z.discriminatedUnion("type", [
428
398
  TextContentZodSchema,
429
399
  ImageContentZodSchema,
430
400
  AudioContentZodSchema,
431
401
  ResourceContentZodSchema,
432
- ResourceLinkZodSchema
402
+ ResourceLinkSchema
433
403
  ]);
434
404
  var ContentResultZodSchema = z.object({
435
405
  _meta: z.record(z.string(), z.unknown()).optional(),
@@ -3186,4 +3156,4 @@ export {
3186
3156
  FastMCPSession,
3187
3157
  FastMCP
3188
3158
  };
3189
- //# sourceMappingURL=chunk-G6TNGO7A.js.map
3159
+ //# sourceMappingURL=chunk-OUD755CE.js.map