@mastra/mcp 2.8.0-alpha.0 → 2.8.0-alpha.1

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/index.js CHANGED
@@ -23219,10 +23219,10 @@ var MCPServer = class extends MCPServerBase {
23219
23219
  });
23220
23220
  this.setTracedHandler(server, "tools/call", async (request, ctx, trace) => {
23221
23221
  const name = request.params.name;
23222
- const tool = this.convertedTools[name];
23222
+ const tool = Object.hasOwn(this.convertedTools, name) ? this.convertedTools[name] : void 0;
23223
23223
  if (!tool) {
23224
23224
  this.logger.warn("Unknown tool requested", { tool: name });
23225
- return errorResult$1(`Unknown tool: ${name}`);
23225
+ throw new ProtocolError$1(ProtocolErrorCode$1.InvalidParams, `Unknown tool: ${name}`);
23226
23226
  }
23227
23227
  const args = request.params.arguments ?? {};
23228
23228
  const argsHash = hashArguments(args);