Remove temporary JSON-RPC envelope unwrapping hack (#90)
The host implementation has been fixed to return the correct result format, so this workaround is no longer needed. Reverts the hack added in #82. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
parent
3aa93db3c3
commit
5ae292106c
1 changed files with 1 additions and 7 deletions
|
|
@ -597,17 +597,11 @@ export class App extends Protocol<Request, Notification, Result> {
|
||||||
params: CallToolRequest["params"],
|
params: CallToolRequest["params"],
|
||||||
options?: RequestOptions,
|
options?: RequestOptions,
|
||||||
): Promise<CallToolResult> {
|
): Promise<CallToolResult> {
|
||||||
const response = await this.request(
|
return await this.request(
|
||||||
{ method: "tools/call", params },
|
{ method: "tools/call", params },
|
||||||
CallToolResultSchema,
|
CallToolResultSchema,
|
||||||
options,
|
options,
|
||||||
);
|
);
|
||||||
// TEMPORAL HACK: Some host implementations incorrectly return the full
|
|
||||||
// JSON-RPC envelope instead of just the result. Unwrap if needed.
|
|
||||||
if (response && "result" in response && "jsonrpc" in response) {
|
|
||||||
return (response as unknown as { result: CallToolResult }).result;
|
|
||||||
}
|
|
||||||
return response;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue