Fix MCP send_http_request ignoring environmentId (#654)

This commit is contained in:
Ricardo Lopes Temoteo authored and GitHub committed 2026-09-15 14:04:38 -07:00
1 parent 4859aba142
commit ab616fd915
11 files changed
+619 -8

No files matched your search

@@ -69,18 +69,24 @@ export function registerHttpRequestTools(server: McpServer, ctx: McpServerContex
description: "Send an HTTP request and get the response",
inputSchema: {
id: z.string().describe("The HTTP request ID to send"),
environmentId: z.string().optional().describe("Optional environment ID to use"),
environmentId: z
.string()
.optional()
.describe("Environment ID for this send only; defaults to the active environment"),
workspaceId: workspaceIdSchema,
},
},
async ({ id, workspaceId }) => {
async ({ id, workspaceId, environmentId }) => {
const workspaceCtx = await getWorkspaceContext(ctx, workspaceId);
const httpRequest = await workspaceCtx.yaak.httpRequest.getById({ id });
if (httpRequest == null) {
throw new Error(`HTTP request with ID ${id} not found`);
}
const { httpResponse: response } = await workspaceCtx.yaak.httpRequest.send({ httpRequest });
const { httpResponse: response } = await workspaceCtx.yaak.httpRequest.send({
httpRequest,
environmentId,
});
return {
content: [