fastmcp 4.14.1 → 4.14.3

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/dist/FastMCP.cjs CHANGED
@@ -11,7 +11,7 @@
11
11
 
12
12
 
13
13
 
14
- var _chunkB5WJ5VRVcjs = require('./chunk-B5WJ5VRV.cjs');
14
+ var _chunkD7MJO6C6cjs = require('./chunk-D7MJO6C6.cjs');
15
15
 
16
16
 
17
17
 
@@ -49,5 +49,5 @@ var _chunk5FVNY65Mcjs = require('./chunk-5FVNY65M.cjs');
49
49
 
50
50
 
51
51
 
52
- exports.AuthProvider = _chunk5FVNY65Mcjs.AuthProvider; exports.AzureProvider = _chunk5FVNY65Mcjs.AzureProvider; exports.DiscoveryDocumentCache = _chunkB5WJ5VRVcjs.DiscoveryDocumentCache; exports.FastMCP = _chunkB5WJ5VRVcjs.FastMCP; exports.FastMCPError = _chunkB5WJ5VRVcjs.FastMCPError; exports.FastMCPSession = _chunkB5WJ5VRVcjs.FastMCPSession; exports.GitHubProvider = _chunk5FVNY65Mcjs.GitHubProvider; exports.GoogleProvider = _chunk5FVNY65Mcjs.GoogleProvider; exports.MEDIA_FETCH_TIMEOUT_MS = _chunkB5WJ5VRVcjs.MEDIA_FETCH_TIMEOUT_MS; exports.OAuthProvider = _chunk5FVNY65Mcjs.OAuthProvider; exports.ServerState = _chunkB5WJ5VRVcjs.ServerState; exports.SessionError = _chunkB5WJ5VRVcjs.SessionError; exports.UnexpectedStateError = _chunkB5WJ5VRVcjs.UnexpectedStateError; exports.UserError = _chunkB5WJ5VRVcjs.UserError; exports.audioContent = _chunkB5WJ5VRVcjs.audioContent; exports.getAuthSession = _chunk5FVNY65Mcjs.getAuthSession; exports.imageContent = _chunkB5WJ5VRVcjs.imageContent; exports.jsonSchemaAdapter = _chunkB5WJ5VRVcjs.jsonSchemaAdapter; exports.requireAll = _chunk5FVNY65Mcjs.requireAll; exports.requireAny = _chunk5FVNY65Mcjs.requireAny; exports.requireAuth = _chunk5FVNY65Mcjs.requireAuth; exports.requireRole = _chunk5FVNY65Mcjs.requireRole; exports.requireScopes = _chunk5FVNY65Mcjs.requireScopes;
52
+ exports.AuthProvider = _chunk5FVNY65Mcjs.AuthProvider; exports.AzureProvider = _chunk5FVNY65Mcjs.AzureProvider; exports.DiscoveryDocumentCache = _chunkD7MJO6C6cjs.DiscoveryDocumentCache; exports.FastMCP = _chunkD7MJO6C6cjs.FastMCP; exports.FastMCPError = _chunkD7MJO6C6cjs.FastMCPError; exports.FastMCPSession = _chunkD7MJO6C6cjs.FastMCPSession; exports.GitHubProvider = _chunk5FVNY65Mcjs.GitHubProvider; exports.GoogleProvider = _chunk5FVNY65Mcjs.GoogleProvider; exports.MEDIA_FETCH_TIMEOUT_MS = _chunkD7MJO6C6cjs.MEDIA_FETCH_TIMEOUT_MS; exports.OAuthProvider = _chunk5FVNY65Mcjs.OAuthProvider; exports.ServerState = _chunkD7MJO6C6cjs.ServerState; exports.SessionError = _chunkD7MJO6C6cjs.SessionError; exports.UnexpectedStateError = _chunkD7MJO6C6cjs.UnexpectedStateError; exports.UserError = _chunkD7MJO6C6cjs.UserError; exports.audioContent = _chunkD7MJO6C6cjs.audioContent; exports.getAuthSession = _chunk5FVNY65Mcjs.getAuthSession; exports.imageContent = _chunkD7MJO6C6cjs.imageContent; exports.jsonSchemaAdapter = _chunkD7MJO6C6cjs.jsonSchemaAdapter; exports.requireAll = _chunk5FVNY65Mcjs.requireAll; exports.requireAny = _chunk5FVNY65Mcjs.requireAny; exports.requireAuth = _chunk5FVNY65Mcjs.requireAuth; exports.requireRole = _chunk5FVNY65Mcjs.requireRole; exports.requireScopes = _chunk5FVNY65Mcjs.requireScopes;
53
53
  //# sourceMappingURL=FastMCP.cjs.map
package/dist/FastMCP.js CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  audioContent,
12
12
  imageContent,
13
13
  jsonSchemaAdapter
14
- } from "./chunk-SGCRCQNU.js";
14
+ } from "./chunk-YAU737SP.js";
15
15
  import {
16
16
  AuthProvider,
17
17
  AzureProvider,
@@ -1439,11 +1439,7 @@ ${error instanceof Error ? error.stack : JSON.stringify(error)}`
1439
1439
  result = ContentResultZodSchema.parse({
1440
1440
  content: [{ text: maybeStringResult, type: "text" }]
1441
1441
  });
1442
- } else if ("type" in maybeStringResult) {
1443
- result = ContentResultZodSchema.parse({
1444
- content: [maybeStringResult]
1445
- });
1446
- } else if ("content" in maybeStringResult) {
1442
+ } else if ("content" in maybeStringResult && Array.isArray(maybeStringResult.content) && (!tool.outputSchema || ContentResultZodSchema.safeParse(maybeStringResult).success)) {
1447
1443
  result = ContentResultZodSchema.parse(maybeStringResult);
1448
1444
  if (result.structuredContent !== void 0 && tool.outputSchema) {
1449
1445
  result.structuredContent = await this.#validateStructuredContent(
@@ -1467,6 +1463,10 @@ ${error instanceof Error ? error.stack : JSON.stringify(error)}`
1467
1463
  ],
1468
1464
  structuredContent
1469
1465
  });
1466
+ } else if ("type" in maybeStringResult) {
1467
+ result = ContentResultZodSchema.parse({
1468
+ content: [maybeStringResult]
1469
+ });
1470
1470
  } else {
1471
1471
  result = ContentResultZodSchema.parse(maybeStringResult);
1472
1472
  }
@@ -2747,4 +2747,4 @@ var FastMCP = class extends FastMCPEventEmitter {
2747
2747
 
2748
2748
 
2749
2749
  exports.DiscoveryDocumentCache = DiscoveryDocumentCache; exports.jsonSchemaAdapter = jsonSchemaAdapter; exports.MEDIA_FETCH_TIMEOUT_MS = MEDIA_FETCH_TIMEOUT_MS; exports.imageContent = imageContent; exports.audioContent = audioContent; exports.FastMCPError = FastMCPError; exports.SessionError = SessionError; exports.UnexpectedStateError = UnexpectedStateError; exports.UserError = UserError; exports.ServerState = ServerState; exports.FastMCPSession = FastMCPSession; exports.FastMCP = FastMCP;
2750
- //# sourceMappingURL=chunk-B5WJ5VRV.cjs.map
2750
+ //# sourceMappingURL=chunk-D7MJO6C6.cjs.map