diff --git a/src/scenarios/server/tools.ts b/src/scenarios/server/tools.ts index 7ecbfdd5..5431be72 100644 --- a/src/scenarios/server/tools.ts +++ b/src/scenarios/server/tools.ts @@ -121,12 +121,20 @@ Implement tool \`test_simple_text\` with no arguments that returns: const connection = await connectToServer(serverUrl); const result = await connection.client.callTool({ - name: 'test_simple_text' - /* omit arguments as it is not required in the schema */ + name: 'test_simple_text', + // Per MCP spec, `arguments` is optional when the tool's inputSchema + // has no required fields. But the typescript-sdk server (<= 1.29.x) + // rejects undefined `arguments` against any inputSchema, returning + // isError: true. Fix merged into main (PR #1404) but not backported + // to the 1.x line — see modelcontextprotocol/typescript-sdk#1869. + // Passing `{}` explicitly until the fix is released. + arguments: {} }); // Validate response const errors: string[] = []; + if ((result as any).isError === true) + errors.push('Tool returned an error instead of content'); const content = (result as any).content; if (!content) errors.push('Missing content array'); if (!Array.isArray(content)) errors.push('content is not an array');