mirror of
https://github.com/modelcontextprotocol/servers.git
synced 2026-02-19 11:54:58 -05:00
fix(everything): move task to params.task and remove pollInterval from requests
- Use params.task instead of params._meta.task for task metadata - Remove pollInterval from task requests (only available on result) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -54,9 +54,8 @@ export const registerTriggerElicitationRequestAsyncTool = (server: McpServer) =>
|
||||
method: "elicitation/create" as const,
|
||||
params: {
|
||||
task: {
|
||||
ttl: 600000, // 10 minutes (user input may take a while)
|
||||
pollInterval: POLL_INTERVAL,
|
||||
},
|
||||
ttl: 600000, // 10 minutes (user input may take a while)
|
||||
},
|
||||
message: "Please provide inputs for the following fields (async task demo):",
|
||||
requestedSchema: {
|
||||
type: "object" as const,
|
||||
|
||||
@@ -63,13 +63,12 @@ export const registerTriggerSamplingRequestAsyncTool = (server: McpServer) => {
|
||||
const { prompt, maxTokens } = validatedArgs;
|
||||
|
||||
// Create the sampling request WITH task metadata
|
||||
// The _meta.task field signals to the client that this should be executed as a task
|
||||
const request: CreateMessageRequest & { params: { _meta?: { task: { ttl: number; pollInterval: number } } } } = {
|
||||
// The params.task field signals to the client that this should be executed as a task
|
||||
const request: CreateMessageRequest & { params: { task?: { ttl: number } } } = {
|
||||
method: "sampling/createMessage",
|
||||
params: {
|
||||
task: {
|
||||
ttl: 300000, // 5 minutes
|
||||
pollInterval: POLL_INTERVAL,
|
||||
},
|
||||
messages: [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user