Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/mcp/tools/mcpToolRuntime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ export const buildMcpToolErrorResponse = (structuredContent: McpToolStructuredCo
text: textContent,
},
],
structuredContent: structuredContent,
// structuredContent is intentionally omitted for error responses
// Error messages have different schema than success responses and may cause validation issues
};
};
6 changes: 0 additions & 6 deletions tests/mcp/tools/fileSystemReadDirectoryTool.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ describe('FileSystemReadDirectoryTool', () => {
text: JSON.stringify({ errorMessage: `Error: Path must be absolute. Received: ${testPath}` }, null, 2),
},
],
structuredContent: {
errorMessage: `Error: Path must be absolute. Received: ${testPath}`,
},
});
});

Expand All @@ -67,9 +64,6 @@ describe('FileSystemReadDirectoryTool', () => {
text: JSON.stringify({ errorMessage: `Error: Directory not found at path: ${testPath}` }, null, 2),
},
],
structuredContent: {
errorMessage: `Error: Directory not found at path: ${testPath}`,
},
});
});
});
6 changes: 0 additions & 6 deletions tests/mcp/tools/fileSystemReadFileTool.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ describe('FileSystemReadFileTool', () => {
text: JSON.stringify({ errorMessage: `Error: Path must be absolute. Received: ${testPath}` }, null, 2),
},
],
structuredContent: {
errorMessage: `Error: Path must be absolute. Received: ${testPath}`,
},
});
});

Expand All @@ -67,9 +64,6 @@ describe('FileSystemReadFileTool', () => {
text: JSON.stringify({ errorMessage: `Error: File not found at path: ${testPath}` }, null, 2),
},
],
structuredContent: {
errorMessage: `Error: File not found at path: ${testPath}`,
},
});
});
});
2 changes: 0 additions & 2 deletions tests/mcp/tools/mcpToolRuntime.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,6 @@ describe('mcpToolRuntime', () => {
text: JSON.stringify(errorContent, null, 2),
},
],
structuredContent: errorContent,
});
});

Expand All @@ -316,7 +315,6 @@ describe('mcpToolRuntime', () => {
text: JSON.stringify(errorContent, null, 2),
},
],
structuredContent: errorContent,
});
});

Expand Down
Loading