Skip to content

Commit 568a3bf

Browse files
docs: align mcpReq.send() schema-param wording with 260fae6 overload
1 parent 2e57b64 commit 568a3bf

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

docs/migration-SKILL.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -416,9 +416,9 @@ Request/notification params remain fully typed. Remove unused schema imports aft
416416
| `ctx.mcpReq.elicitInput(params, options?)` | Elicit user input (form or URL) | `server.elicitInput(...)` from within handler |
417417
| `ctx.mcpReq.requestSampling(params, options?)` | Request LLM sampling from client | `server.createMessage(...)` from within handler |
418418

419-
## 11. Schema parameter on `request()` / `callTool()` is optional; removed from `send()`
419+
## 11. Schema parameter on `request()` / `callTool()` / `mcpReq.send()` is optional
420420

421-
`Protocol.request()` and `Client.callTool()` still accept a Zod result schema as the second argument (the v1 form), but it is optional for spec methods — the SDK resolves the schema internally from the method name. `BaseContext.mcpReq.send()` no longer takes a schema.
421+
`Protocol.request()`, `BaseContext.mcpReq.send()`, and `Client.callTool()` still accept a result schema as the second argument (the v1 form), but for spec methods it is optional — the SDK resolves the schema internally from the method name. The schema argument remains the supported call form for custom (non-spec) methods.
422422

423423
```typescript
424424
// v1: schema required
@@ -427,7 +427,7 @@ const result = await client.request({ method: 'tools/call', params: { ... } }, C
427427
const elicit = await ctx.mcpReq.send({ method: 'elicitation/create', params: { ... } }, ElicitResultSchema);
428428
const tool = await client.callTool({ name: 'my-tool', arguments: {} }, CompatibilityCallToolResultSchema);
429429

430-
// v2: schema optional on request()/callTool(); removed from mcpReq.send()
430+
// v2: schema optional on request()/callTool()/mcpReq.send() for spec methods
431431
const result = await client.request({ method: 'tools/call', params: { ... } });
432432
const elicit = await ctx.mcpReq.send({ method: 'elicitation/create', params: { ... } });
433433
const tool = await client.callTool({ name: 'my-tool', arguments: {} });
@@ -437,12 +437,12 @@ const tool = await client.callTool({ name: 'my-tool', arguments: {} });
437437
| ------------------------------------------------------------ | ---------------------------------------------- |
438438
| `client.request(req, ResultSchema)` | unchanged (schema optional), or `client.request(req)` |
439439
| `client.request(req, ResultSchema, options)` | unchanged, or `client.request(req, options)` |
440-
| `ctx.mcpReq.send(req, ResultSchema)` | `ctx.mcpReq.send(req)` |
441-
| `ctx.mcpReq.send(req, ResultSchema, options)` | `ctx.mcpReq.send(req, options)` |
440+
| `ctx.mcpReq.send(req, ResultSchema)` | unchanged (schema optional), or `ctx.mcpReq.send(req)` |
441+
| `ctx.mcpReq.send(req, ResultSchema, options)` | unchanged, or `ctx.mcpReq.send(req, options)` |
442442
| `client.callTool(params, CompatibilityCallToolResultSchema)` | unchanged (schema ignored), or `client.callTool(params)` |
443443
| `client.callTool(params, schema, options)` | unchanged, or `client.callTool(params, options)` |
444444

445-
Remove unused schema imports: `CallToolResultSchema`, `CompatibilityCallToolResultSchema`, `ElicitResultSchema`, `CreateMessageResultSchema`, etc., when they were only used in `request()`/`send()`/`callTool()` calls.
445+
For spec methods you can drop now-unused schema imports (`CallToolResultSchema`, `CompatibilityCallToolResultSchema`, `ElicitResultSchema`, `CreateMessageResultSchema`, etc.) when they were only used in `request()`/`send()`/`callTool()` calls.
446446

447447
If `CallToolResultSchema` was used for **runtime validation** (not just as a `request()` argument), replace with the `isCallToolResult` type guard:
448448

docs/migration.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -397,10 +397,10 @@ server.setRequestHandler(SearchRequestSchema, req => ({ hits: [req.params.query]
397397
const result = await client.request({ method: 'acme/search', params: { query: 'x' } }, SearchResult);
398398
```
399399

400-
### `Protocol.request()` and `Client.callTool()` schema parameter is now optional
400+
### `Protocol.request()`, `ctx.mcpReq.send()`, and `Client.callTool()` schema parameter is now optional
401401

402-
The public `Protocol.request()` and `Client.callTool()` methods still accept a result schema argument, but for spec methods it is optional — the SDK resolves the correct schema internally from the method name. You no longer need to import result schemas
403-
like `CallToolResultSchema` or `ElicitResultSchema` when making requests. (`BaseContext.mcpReq.send()` no longer accepts a schema; drop it.)
402+
The public `Protocol.request()`, `BaseContext.mcpReq.send()`, and `Client.callTool()` methods still accept a result schema argument, but for spec methods it is optional — the SDK resolves the correct schema internally from the method name. You no longer need to import result schemas
403+
like `CallToolResultSchema` or `ElicitResultSchema` when making spec-method requests. The schema argument remains the supported call form for custom (non-spec) methods.
404404

405405
**`client.request()` — Before (v1):**
406406

0 commit comments

Comments
 (0)