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:
parent
a160653441
commit
1542b65154
2 changed files with 4 additions and 6 deletions
|
|
@ -54,9 +54,8 @@ export const registerTriggerElicitationRequestAsyncTool = (server: McpServer) =>
|
||||||
method: "elicitation/create" as const,
|
method: "elicitation/create" as const,
|
||||||
params: {
|
params: {
|
||||||
task: {
|
task: {
|
||||||
ttl: 600000, // 10 minutes (user input may take a while)
|
ttl: 600000, // 10 minutes (user input may take a while)
|
||||||
pollInterval: POLL_INTERVAL,
|
},
|
||||||
},
|
|
||||||
message: "Please provide inputs for the following fields (async task demo):",
|
message: "Please provide inputs for the following fields (async task demo):",
|
||||||
requestedSchema: {
|
requestedSchema: {
|
||||||
type: "object" as const,
|
type: "object" as const,
|
||||||
|
|
|
||||||
|
|
@ -63,13 +63,12 @@ export const registerTriggerSamplingRequestAsyncTool = (server: McpServer) => {
|
||||||
const { prompt, maxTokens } = validatedArgs;
|
const { prompt, maxTokens } = validatedArgs;
|
||||||
|
|
||||||
// Create the sampling request WITH task metadata
|
// Create the sampling request WITH task metadata
|
||||||
// The _meta.task field signals to the client that this should be executed as a task
|
// The params.task field signals to the client that this should be executed as a task
|
||||||
const request: CreateMessageRequest & { params: { _meta?: { task: { ttl: number; pollInterval: number } } } } = {
|
const request: CreateMessageRequest & { params: { task?: { ttl: number } } } = {
|
||||||
method: "sampling/createMessage",
|
method: "sampling/createMessage",
|
||||||
params: {
|
params: {
|
||||||
task: {
|
task: {
|
||||||
ttl: 300000, // 5 minutes
|
ttl: 300000, // 5 minutes
|
||||||
pollInterval: POLL_INTERVAL,
|
|
||||||
},
|
},
|
||||||
messages: [
|
messages: [
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue