Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/scenarios/server/tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down