A task-augmented tools/call can't return a CreateTaskResult on a 2025-11-25 session
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 66/100
- Issue-Typ
- Bug
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- node.js, typescript
- Bereich
- backend-api-design
Rechercherichtung
Start by reading the server's tools/call request handler and result validation, then compare it with the 1.32.1 behavior described in the issue. Reproduce the case with params.task and the supplied handler result. Done means the task request accepts and returns a valid CreateTaskResult on the 2025-11-25 path while ordinary tool calls continue to validate as CallToolResult.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Package: @modelcontextprotocol/server 2.4.0
Compared with: @modelcontextprotocol/sdk 1.32.1
Runtime: Node.js 24.22.1
Summary
In the 2025-11-25 revision, a tools/call whose params carry task is answered with a CreateTaskResult ({ task: { taskId, status, … } }). Server wraps every tools/call handler and validates its result as a CallToolResult, whatever the request carried, so a server that implements 2025-11-25 tasks itself gets -32602 Invalid tools/call result instead of its task result. 1.32.1 validated the result against CreateTaskResultSchema when params.task was set.
This is the 2025-11-25 core tasks path (params.task on tools/call), not the 2026-07-28 tasks extension covered by #2637.
Reproduction
const { Server, InMemoryTransport } = require('@modelcontextprotocol/server');
const { Client } = require('@modelcontextprotocol/client');
(async () => {
const server = new Server({ name: 'repro', version: '1.0.0' }, { capabilities: { tools: {} } });
const now = new Date().toISOString();
server.setRequestHandler('tools/call', async () => ({
task: { taskId: 't-1', status: 'working', ttl: 60000, createdAt: now, lastUpdatedAt: now },
}));
const [clientTransport, serverTransport] = InMemoryTransport.createLinkedPair();
await server.connect(serverTransport);
const client = new Client({ name: 'c', version: '1' });
await client.connect(clientTransport);
const passThrough = { '~standard': { version: 1, vendor: 'repro', validate: (value) => ({ value }) } };
const result = await client
.request({ method: 'tools/call', params: { name: 'slow', arguments: {}, task: { ttl: 60000 } } }, passThrough)
.catch((error) => error.message);
console.log(result);
})();
Expected
The CreateTaskResult the handler returned.
Actual
Invalid tools/call result: [ { "code": "custom",
"message": "content is required when the body carries 'task' — another result family cannot default into an empty tools/call success", … } ]
Suggestion
When the request carries params.task on a 2025-era session, validate the result as a CreateTaskResult (as 1.x did), even without a built-in tasks runtime, so servers that keep their own task store can serve 2025-11-25 tasks.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 13.8k
- Forks
- 2.5k
- Ø Merge
- 6 T. 23 Std.
- Gemergte PRs (30 T.)
- 2
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus modelcontextprotocol/typescript-sdk
-
v2
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 72/100
modelcontextprotocol/typescript-sdk#3270 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
`callTool` with `allowInputRequired: true` throws on an `input_required` result when the tool declares an `outputSchema`Evtl. vergeben @mgoldsborough hat das vor 6 Tagen übernommen. Offenv2
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
modelcontextprotocol/typescript-sdk#3249 ·
Maintainer antworten meist innerhalb von 1 Tag
-
v2
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
modelcontextprotocol/typescript-sdk#3243 · 3 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
TypeScript client accepts an unknown `resultType` in the first `server/discover` replyEvtl. vergeben @Tidehyc hat das vor 8 Tagen übernommen. Offenv2
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
modelcontextprotocol/typescript-sdk#3235 · 3 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
UriTemplate.match() throws a TypeError on an empty expression it acceptsEvtl. vergeben @yunusemrejs hat das vor 12 Tagen übernommen. Offenv1 v2
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 80/100
modelcontextprotocol/typescript-sdk#3221 · 3 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in modelcontextprotocol/typescript-sdk
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
laststance/design-world#98 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Add: KCM True crimeOffenapproved check:passed streams:add
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
Maintainer antworten meist innerhalb von 1 Tag
-
triage: failed
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
oxc-project/tsrs#1277 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
ardia-browser/ardia#6798 ·
Maintainer antworten meist innerhalb von 1 Tag