Skip to content

Commit a452e8d

Browse files
committed
mark isError as true
1 parent c6d15bb commit a452e8d

3 files changed

Lines changed: 5 additions & 7 deletions

File tree

src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,9 @@ export async function createMcpServer(
271271
} = {
272272
content,
273273
};
274+
if (response.error) {
275+
result.isError = true;
276+
}
274277
success = true;
275278
if (serverArgs.experimentalStructuredContent) {
276279
result.structuredContent = structuredContent as Record<

tests/index.test.js.snapshot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ exports[`e2e > calls a tool multiple times 1`] = `
77
`;
88

99
exports[`e2e > returns blocked message when dialog is opened during tool execution 1`] = `
10-
[{"type":"text","text":"# Open dialog\\nalert: test dialog.\\nCall handle_dialog to handle it before continuing.\\nError: Failed to interact with the element with uid 1_1. The element did not become interactive within the configured timeout."}]
10+
{"content":[{"type":"text","text":"# Open dialog\\nalert: test dialog.\\nCall handle_dialog to handle it before continuing.\\nError: Failed to interact with the element with uid 1_1. The element did not become interactive within the configured timeout."}],"isError":true}
1111
`;

tests/index.test.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -273,12 +273,7 @@ describe('e2e', () => {
273273
},
274274
});
275275

276-
const content = result.content as TextContent[];
277-
assert.match(
278-
content[0].text,
279-
/Call handle_dialog to handle it before continuing/,
280-
);
281-
t.assert.snapshot?.(JSON.stringify(result.content));
276+
t.assert.snapshot?.(JSON.stringify(result));
282277
});
283278
});
284279
});

0 commit comments

Comments
 (0)