@mastra/mcp 2.6.0-alpha.1 → 2.6.0-alpha.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.
@@ -3,7 +3,7 @@ name: mastra-mcp
3
3
  description: Documentation for @mastra/mcp. Use when working with @mastra/mcp APIs, configuration, or implementation.
4
4
  metadata:
5
5
  package: "@mastra/mcp"
6
- version: "2.6.0-alpha.1"
6
+ version: "2.6.0-alpha.3"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.6.0-alpha.1",
2
+ "version": "2.6.0-alpha.3",
3
3
  "package": "@mastra/mcp",
4
4
  "exports": {},
5
5
  "modules": {}
package/dist/index.cjs CHANGED
@@ -20903,21 +20903,31 @@ var MCPServer = class extends _mastra_core_mcp.MCPServerBase {
20903
20903
  ui: { resourceUri },
20904
20904
  [_modelcontextprotocol_ext_apps.RESOURCE_URI_META_KEY]: resourceUri
20905
20905
  } } : {};
20906
- if (!tool.outputSchema) return {
20907
- isError: false,
20908
- content: [{
20909
- type: "text",
20910
- text: typeof value === "string" ? value : JSON.stringify(value)
20911
- }],
20912
- ...meta
20913
- };
20914
- const structuredContent = value;
20906
+ if (!tool.outputSchema) {
20907
+ const text = typeof value === "string" ? value : JSON.stringify(value);
20908
+ return {
20909
+ isError: false,
20910
+ content: text === void 0 ? [] : [{
20911
+ type: "text",
20912
+ text
20913
+ }],
20914
+ ...meta
20915
+ };
20916
+ }
20917
+ const text = JSON.stringify(value);
20918
+ if (text === void 0) {
20919
+ this.logger.warn(`Tool '${name}' declares an outputSchema but returned no structured output.`);
20920
+ return {
20921
+ ...errorResult$1(`Tool '${name}' declares an outputSchema but returned no output.`),
20922
+ ...meta
20923
+ };
20924
+ }
20915
20925
  return {
20916
20926
  isError: false,
20917
- structuredContent,
20927
+ structuredContent: value,
20918
20928
  content: [{
20919
20929
  type: "text",
20920
- text: JSON.stringify(structuredContent)
20930
+ text
20921
20931
  }],
20922
20932
  ...meta
20923
20933
  };