fastmcp 4.22.0 → 4.22.2

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 _chunkV4JBWBT4cjs = require('./chunk-V4JBWBT4.cjs');
14
+ var _chunkV37MCHBLcjs = require('./chunk-V37MCHBL.cjs');
15
15
 
16
16
 
17
17
 
@@ -50,5 +50,5 @@ require('./chunk-O22SYZMC.cjs');
50
50
 
51
51
 
52
52
 
53
- exports.AuthProvider = _chunkYOBCXNFPcjs.AuthProvider; exports.AzureProvider = _chunkYOBCXNFPcjs.AzureProvider; exports.DiscoveryDocumentCache = _chunkV4JBWBT4cjs.DiscoveryDocumentCache; exports.FastMCP = _chunkV4JBWBT4cjs.FastMCP; exports.FastMCPError = _chunkV4JBWBT4cjs.FastMCPError; exports.FastMCPSession = _chunkV4JBWBT4cjs.FastMCPSession; exports.GitHubProvider = _chunkYOBCXNFPcjs.GitHubProvider; exports.GoogleProvider = _chunkYOBCXNFPcjs.GoogleProvider; exports.MEDIA_FETCH_TIMEOUT_MS = _chunkV4JBWBT4cjs.MEDIA_FETCH_TIMEOUT_MS; exports.OAuthProvider = _chunkYOBCXNFPcjs.OAuthProvider; exports.ServerState = _chunkV4JBWBT4cjs.ServerState; exports.SessionError = _chunkV4JBWBT4cjs.SessionError; exports.UnexpectedStateError = _chunkV4JBWBT4cjs.UnexpectedStateError; exports.UserError = _chunkV4JBWBT4cjs.UserError; exports.audioContent = _chunkV4JBWBT4cjs.audioContent; exports.getAuthSession = _chunkYOBCXNFPcjs.getAuthSession; exports.imageContent = _chunkV4JBWBT4cjs.imageContent; exports.jsonSchemaAdapter = _chunkV4JBWBT4cjs.jsonSchemaAdapter; exports.requireAll = _chunkYOBCXNFPcjs.requireAll; exports.requireAny = _chunkYOBCXNFPcjs.requireAny; exports.requireAuth = _chunkYOBCXNFPcjs.requireAuth; exports.requireRole = _chunkYOBCXNFPcjs.requireRole; exports.requireScopes = _chunkYOBCXNFPcjs.requireScopes;
53
+ exports.AuthProvider = _chunkYOBCXNFPcjs.AuthProvider; exports.AzureProvider = _chunkYOBCXNFPcjs.AzureProvider; exports.DiscoveryDocumentCache = _chunkV37MCHBLcjs.DiscoveryDocumentCache; exports.FastMCP = _chunkV37MCHBLcjs.FastMCP; exports.FastMCPError = _chunkV37MCHBLcjs.FastMCPError; exports.FastMCPSession = _chunkV37MCHBLcjs.FastMCPSession; exports.GitHubProvider = _chunkYOBCXNFPcjs.GitHubProvider; exports.GoogleProvider = _chunkYOBCXNFPcjs.GoogleProvider; exports.MEDIA_FETCH_TIMEOUT_MS = _chunkV37MCHBLcjs.MEDIA_FETCH_TIMEOUT_MS; exports.OAuthProvider = _chunkYOBCXNFPcjs.OAuthProvider; exports.ServerState = _chunkV37MCHBLcjs.ServerState; exports.SessionError = _chunkV37MCHBLcjs.SessionError; exports.UnexpectedStateError = _chunkV37MCHBLcjs.UnexpectedStateError; exports.UserError = _chunkV37MCHBLcjs.UserError; exports.audioContent = _chunkV37MCHBLcjs.audioContent; exports.getAuthSession = _chunkYOBCXNFPcjs.getAuthSession; exports.imageContent = _chunkV37MCHBLcjs.imageContent; exports.jsonSchemaAdapter = _chunkV37MCHBLcjs.jsonSchemaAdapter; exports.requireAll = _chunkYOBCXNFPcjs.requireAll; exports.requireAny = _chunkYOBCXNFPcjs.requireAny; exports.requireAuth = _chunkYOBCXNFPcjs.requireAuth; exports.requireRole = _chunkYOBCXNFPcjs.requireRole; exports.requireScopes = _chunkYOBCXNFPcjs.requireScopes;
54
54
  //# 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-43N2Q6ZI.js";
14
+ } from "./chunk-TFX7BV4K.js";
15
15
  import {
16
16
  AuthProvider,
17
17
  AzureProvider,
@@ -201,7 +201,7 @@ async function compileSchema(schema) {
201
201
  return ajv.compile(schema);
202
202
  }
203
203
  function toIssue(error) {
204
- const path = error.instancePath.split("/").filter(Boolean).map((segment) => segment.replaceAll("~1", "/").replaceAll("~0", "~")).map((segment) => {
204
+ const path = error.instancePath.split("/").slice(1).map((segment) => segment.replaceAll("~1", "/").replaceAll("~0", "~")).map((segment) => {
205
205
  const index = Number(segment);
206
206
  return /^(?:0|[1-9]\d*)$/.test(segment) && Number.isSafeInteger(index) ? index : segment;
207
207
  });
@@ -1324,8 +1324,9 @@ ${error instanceof Error ? error.stack : JSON.stringify(error)}`
1324
1324
  };
1325
1325
  }
1326
1326
  throw new McpError(
1327
- ErrorCode.MethodNotFound,
1328
- `Resource not found: '${request.params.uri}'. Available resources: ${Array.from(this.#resources.values()).map((r) => r.uri).join(", ") || "none"}`
1327
+ ErrorCode.InvalidParams,
1328
+ `Resource not found: '${request.params.uri}'. Available resources: ${Array.from(this.#resources.values()).map((r) => r.uri).join(", ") || "none"}`,
1329
+ { uri: request.params.uri }
1329
1330
  );
1330
1331
  }
1331
1332
  if (!("uri" in resource)) {
@@ -1474,7 +1475,7 @@ ${error instanceof Error ? error.stack : JSON.stringify(error)}`
1474
1475
  const tool = toolsMap.get(request.params.name);
1475
1476
  if (!tool) {
1476
1477
  throw new McpError(
1477
- ErrorCode.MethodNotFound,
1478
+ ErrorCode.InvalidParams,
1478
1479
  `Unknown tool: ${request.params.name}`
1479
1480
  );
1480
1481
  }
@@ -3047,4 +3048,4 @@ export {
3047
3048
  FastMCPSession,
3048
3049
  FastMCP
3049
3050
  };
3050
- //# sourceMappingURL=chunk-43N2Q6ZI.js.map
3051
+ //# sourceMappingURL=chunk-TFX7BV4K.js.map