mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-08-20 10:24:01 +02:00
Hand the body back from send instead of holding it for a lookup
Holding an unsaved body against its response id let a plugin stash the id and read it in a later call, which would throw only sometimes and only for ad-hoc sends. Documenting that was never going to be enough. send now returns the response and its body together, so there is nothing to stash: an unsaved body is a value you were handed. ctx.httpResponse .body() goes back to meaning one thing, a saved response read by id, and refuses ids it has no row for. Reading is identical either way, so no caller has to know which kind of send it made.
This commit is contained in:
@@ -80,7 +80,7 @@ export function registerHttpRequestTools(server: McpServer, ctx: McpServerContex
|
||||
throw new Error(`HTTP request with ID ${id} not found`);
|
||||
}
|
||||
|
||||
const response = await workspaceCtx.yaak.httpRequest.send({ httpRequest });
|
||||
const { httpResponse: response } = await workspaceCtx.yaak.httpRequest.send({ httpRequest });
|
||||
|
||||
return {
|
||||
content: [
|
||||
|
||||
Reference in New Issue
Block a user