Skip to content

Commit 0b9b780

Browse files
docs: mcpReq.send() schema parameter is optional, not removed
1 parent 10164d3 commit 0b9b780

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

docs/migration-SKILL.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ fields.
442442

443443
## 11. Schema parameter on `request()` and `callTool()` is now optional (`@deprecated`)
444444

445-
`Protocol.request()`, `BaseContext.mcpReq.send()`, `Client.callTool()`, and `client.experimental.tasks.callToolStream()` no longer take a Zod result schema argument. The SDK resolves the schema internally from the method name.
445+
`Protocol.request()`, `BaseContext.mcpReq.send()`, and `Client.callTool()` still accept a result schema argument, but for spec methods it is optional — the SDK resolves the schema internally from the method name. The schema argument remains the supported form for custom (non-spec) methods. `client.experimental.tasks.callToolStream()` no longer takes a schema argument.
446446

447447
```typescript
448448
// v1: schema required
@@ -451,7 +451,7 @@ const result = await client.request({ method: 'tools/call', params: { ... } }, C
451451
const elicit = await ctx.mcpReq.send({ method: 'elicitation/create', params: { ... } }, ElicitResultSchema);
452452
const tool = await client.callTool({ name: 'my-tool', arguments: {} }, CompatibilityCallToolResultSchema);
453453

454-
// v2: no schema argument
454+
// v2: schema optional for spec methods
455455
const result = await client.request({ method: 'tools/call', params: { ... } });
456456
const elicit = await ctx.mcpReq.send({ method: 'elicitation/create', params: { ... } });
457457
const tool = await client.callTool({ name: 'my-tool', arguments: {} });

docs/migration.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -500,10 +500,10 @@ Common method string replacements:
500500
| `ElicitationCompleteNotificationSchema` | `'notifications/elicitation/complete'` |
501501
| `InitializedNotificationSchema` | `'notifications/initialized'` |
502502

503-
### `Protocol.request()`, `ctx.mcpReq.send()`, and `Client.callTool()` no longer take a schema parameter
503+
### `Protocol.request()` and `Client.callTool()` schema parameter is now optional
504504

505-
The public `Protocol.request()`, `BaseContext.mcpReq.send()`, `Client.callTool()`, and `client.experimental.tasks.callToolStream()` methods no longer accept a Zod result schema argument. The SDK now resolves the correct result schema internally based on the method name. This
506-
means you no longer need to import result schemas like `CallToolResultSchema` or `ElicitResultSchema` when making requests.
505+
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
506+
schemas like `CallToolResultSchema` or `ElicitResultSchema` when making requests. The schema argument remains the supported form for custom (non-spec) methods.
507507

508508
**`client.request()` — Before (v1):**
509509

0 commit comments

Comments
 (0)