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:
Anton Pidkuiko 2025-12-08 15:32:15 +00:00 • committed by GitHub
commit 5ae292106c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -597,17 +597,11 @@ export class App extends Protocol<Request, Notification, Result> {
params: CallToolRequest["params"],
options?: RequestOptions,
): Promise<CallToolResult> {
const response = await this.request(
return await this.request(
{ method: "tools/call", params },
CallToolResultSchema,
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;
}
/**