Fix example to properly position tool annotations

This commit is contained in:
Basil Hosmer 2025-04-10 23:23:41 -04:00
commit c5e81adcd8
No known key found for this signature in database

View file

@ -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
}
);