feat(exa): replaced raw JSON responses with human-readable formatting

- Added formatGenericResponse to handle objects, arrays, MCP content blocks, and primitives.
- Applied formatted output to MCPWrappedTool, createExaTool, and propose-changelog tool.
- Replaced raw response in details field with structured response object.
This commit is contained in:
can1357
2026-05-14 05:51:13 +02:00
parent fe7b3d7005
commit cf4173a100
3 changed files with 86 additions and 6 deletions
@@ -130,8 +130,15 @@ export function createProposeChangelogTool(
state.changelogProposal = { entries: normalized };
}
let text = response.valid ? "Changelog entries accepted." : "Changelog validation failed.";
if (response.errors.length > 0) {
text += `\n\nErrors:\n${response.errors.map(e => `- ${e}`).join("\n")}`;
}
if (response.warnings.length > 0) {
text += `\n\nWarnings:\n${response.warnings.map(w => `- ${w}`).join("\n")}`;
}
return {
content: [{ type: "text", text: JSON.stringify(response, null, 2) }],
content: [{ type: "text", text }],
details: response,
};
},