Skip to content

Commit 419efe5

Browse files
committed
test(e2e): stabilize MCP tool message flow
1 parent 0a05ea8 commit 419efe5

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

integration-tests/sdk-typescript/mcp-server.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,8 @@ describe('MCP Server Integration (E2E)', () => {
477477
describe('MCP Tool Message Flow', () => {
478478
it('should receive proper message sequence for MCP tool usage', async () => {
479479
const q = query({
480-
prompt: 'Use add to calculate 2 + 3',
480+
prompt:
481+
'Use the add tool to calculate 2 + 3. You must call the tool. Just give me the result.',
481482
options: {
482483
...SHARED_TEST_OPTIONS,
483484
cwd: testDir,
@@ -500,10 +501,9 @@ describe('MCP Server Integration (E2E)', () => {
500501
messageTypes.push(message.type);
501502

502503
if (isSDKAssistantMessage(message)) {
503-
const toolUseBlocks = findToolUseBlocks(message);
504+
const toolUseBlocks = findToolUseBlocks(message, MCP_ADD_TOOL);
504505
if (toolUseBlocks.length > 0) {
505506
foundToolUse = true;
506-
expect(toolUseBlocks[0].name).toBe(MCP_ADD_TOOL);
507507
expect(toolUseBlocks[0].input).toBeDefined();
508508
}
509509
}

0 commit comments

Comments
 (0)