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:
@@ -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,
|
||||
};
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user