Commit 16ff78a
fix: pass empty args to registerToolTask createTask handler when no inputSchema
When registerToolTask is used without inputSchema, the createTask handler
should receive an empty object as its first argument when the handler
expects two arguments (args, ctx). This fixes the case where users define
a two-argument handler but omit inputSchema - previously the second
argument (ctx) would be passed as the first argument instead.
Uses Function.length to detect handler arity: single-arg handlers
continue to receive just ctx, while two-arg handlers get ({}, ctx).
Closes #1471
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 42b3359 commit 16ff78a
File tree
2 files changed
+8
-3
lines changed- .changeset
- packages/server/src/server
2 files changed
+8
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1042 | 1042 | | |
1043 | 1043 | | |
1044 | 1044 | | |
1045 | | - | |
1046 | | - | |
| 1045 | + | |
| 1046 | + | |
1047 | 1047 | | |
1048 | | - | |
| 1048 | + | |
1049 | 1049 | | |
1050 | 1050 | | |
1051 | 1051 | | |
| |||
0 commit comments