Fix example to properly position tool annotations
This commit is contained in:
parent
0096be432f
commit
c5e81adcd8
1 changed files with 6 additions and 11 deletions
|
|
@ -29,21 +29,21 @@ server.tool(
|
|||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
{
|
||||
title: 'Greeting Tool',
|
||||
readOnlyHint: true,
|
||||
openWorldHint: false
|
||||
}
|
||||
);
|
||||
|
||||
// Register a tool that sends multiple greetings with notifications
|
||||
// Register a tool that sends multiple greetings with notifications (with annotations)
|
||||
server.tool(
|
||||
'multi-greet',
|
||||
'A tool that sends different greetings with delays between them',
|
||||
{
|
||||
name: z.string().describe('Name to greet'),
|
||||
},
|
||||
{
|
||||
title: 'Multiple Greeting Tool',
|
||||
readOnlyHint: true,
|
||||
openWorldHint: false
|
||||
},
|
||||
async ({ name }, { sendNotification }): Promise<CallToolResult> => {
|
||||
const sleep = (ms: number) => new Promise(resolve => setTimeout(resolve, ms));
|
||||
|
||||
|
|
@ -74,11 +74,6 @@ server.tool(
|
|||
}
|
||||
],
|
||||
};
|
||||
},
|
||||
{
|
||||
title: 'Multiple Greeting Tool',
|
||||
readOnlyHint: true,
|
||||
openWorldHint: false
|
||||
}
|
||||
);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue