From c5e81adcd80014ab3f82c3ef1c0d9f60b76809f4 Mon Sep 17 00:00:00 2001 From: Basil Hosmer Date: Thu, 10 Apr 2025 23:23:41 -0400 Subject: [PATCH] Fix example to properly position tool annotations --- src/examples/server/simpleStreamableHttp.ts | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/examples/server/simpleStreamableHttp.ts b/src/examples/server/simpleStreamableHttp.ts index 99e1bc1b..328e8715 100644 --- a/src/examples/server/simpleStreamableHttp.ts +++ b/src/examples/server/simpleStreamableHttp.ts @@ -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 => { const sleep = (ms: number) => new Promise(resolve => setTimeout(resolve, ms)); @@ -74,11 +74,6 @@ server.tool( } ], }; - }, - { - title: 'Multiple Greeting Tool', - readOnlyHint: true, - openWorldHint: false } );