Skip to content

Comments

Update README.md about client.callTool#141

Merged
jspahrsummers merged 1 commit intomodelcontextprotocol:mainfrom
funwarioisii:fix-docs-client-call-tool
Jan 27, 2025
Merged

Update README.md about client.callTool#141
jspahrsummers merged 1 commit intomodelcontextprotocol:mainfrom
funwarioisii:fix-docs-client-call-tool

Conversation

@funwarioisii
Copy link
Contributor

@funwarioisii funwarioisii commented Jan 27, 2025

Motivation and Context

The Writing MCP Clients in the README did not work correctly and I want to fix it.

How Has This Been Tested?

I used @modelcontextprotocol/server-puppeteer to check the operation at hand

const transport = new StdioClientTransport({
	command: "npx",
	args: ["-y", "@modelcontextprotocol/server-puppeteer"],
});

const client = new Client(
	{
		name: "example-client",
		version: "1.0.0",
	},
	{
		capabilities: {
			prompts: {},
			resources: {},
			tools: {},
		},
	},
);

await client.connect(transport);

const result = await client.callTool({
  name: "puppeteer_navigate",
  arguments: {
		url: "https://google.com",
	},
});
console.dir(result, { depth: null });

await client.close();

Breaking Changes

No.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

The type declaration for client.callTool can be found here.

async callTool(
params: CallToolRequest["params"],
resultSchema:

typescript-sdk/src/types.ts

Lines 773 to 779 in 87197fb

export const CallToolRequestSchema = RequestSchema.extend({
method: z.literal("tools/call"),
params: BaseRequestParamsSchema.extend({
name: z.string(),
arguments: z.optional(z.record(z.unknown())),
}),
});

Following the current documentation would result in the following type error

error TS2345: Argument of type 'string' is not assignable to parameter of type '{ [x: string]: unknown; name: string; _meta?: { [x: string]: unknown; progressToken?: string | number | undefined; } | undefined; arguments?: { [x: string]: unknown; } | undefined; }'

I have corrected this diff.

Copy link
Member

@jspahrsummers jspahrsummers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@jspahrsummers jspahrsummers merged commit 13c3eea into modelcontextprotocol:main Jan 27, 2025
felixweinberger added a commit that referenced this pull request Feb 10, 2026
Conformance CI now gates merges: unexpected failures block PRs, but
known failures in the baseline are tolerated. Stale baseline entries
(scenarios that start passing) also block, forcing cleanup.

Current baseline:
- tools_call: conformance runner bug (fix merged in PR #141, pending release)
- auth/pre-registration: needs client handler (not yet in main either)

Also pins conformance to 0.1.11.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
felixweinberger added a commit that referenced this pull request Feb 16, 2026
Add client-side conformance test for the auth/pre-registration scenario,
which tests OAuth flows with pre-registered credentials (no dynamic
client registration).

- Add pre-registration scenario handler to everythingClient.ts
- Bump @modelcontextprotocol/conformance to 0.1.14 (fixes tools_call
  race condition from PR #141, adds cross-app-access scenario)
- Update baseline: remove tools_call (now fixed), remove
  auth/pre-registration (now implemented), add
  auth/cross-app-access-complete-flow (SEP-990, not yet implemented)

Conformance results: 23/24 client scenarios pass (281 checks),
1 expected failure (auth/cross-app-access-complete-flow).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants