-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Open
Labels
P3Nice to haves, rare edge casesNice to haves, rare edge casesenhancementRequest for a new feature that's not currently supportedRequest for a new feature that's not currently supportedready for workEnough information for someone to start working onEnough information for someone to start working on
Description
Currently one needs to do something like:
server.tool('elicit_inputs', 'Elicitation test tool', {}, async (_request, extra) => {
const result = await server.server.elicitInput(
{
message: 'Please provide inputs for the following fields:',
requestedSchema: ...
},
{
relatedRequestId: extra.requestId,
},
)
...
})I think we should add a zod-typed elicitInput method to tool callback extras + McpServer that then calls the low-level server's elicitInput (related to #662):
// Tool-related elicitation:
server.tool('elicit_inputs', 'Elicitation test tool', {}, async (_request, extra) => {
const result = await extra.elicitInput(
'Please provide inputs for the following fields:',
z.object(...))
...
})
// Non-tool-related elicitation
setInterval(async () => {
const {action, content} = await server.elicitInput('It has been an hour. Wanna post something?', z.object(....), {timeout: 30_000});
if (action == 'accept) ...
}, 3_600_000);
// Note: some connections might need help to stay alive.
setInterval(() => server.ping(), 5_000);Metadata
Metadata
Assignees
Labels
P3Nice to haves, rare edge casesNice to haves, rare edge casesenhancementRequest for a new feature that's not currently supportedRequest for a new feature that's not currently supportedready for workEnough information for someone to start working onEnough information for someone to start working on