File tree Expand file tree Collapse file tree 4 files changed +8
-8
lines changed
examples/servers/apps-sdk/src Expand file tree Collapse file tree 4 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ server.addTool({
5252 validator : new ZodValidator (
5353 z . object ( { } )
5454 ) ,
55- annotation : {
55+ annotations : {
5656 readOnlyHint : true ,
5757 } ,
5858 _meta : {
Original file line number Diff line number Diff line change @@ -162,7 +162,7 @@ export class MCPServer {
162162 handler,
163163 description = `Execute the ${ name } tool` ,
164164 outputSchema,
165- annotation ,
165+ annotations ,
166166 _meta,
167167 } = config ;
168168
@@ -171,7 +171,7 @@ export class MCPServer {
171171 description,
172172 inputSchema : validator . jsonSchema as Tool [ "inputSchema" ] ,
173173 ...( outputSchema && { outputSchema } ) ,
174- ...( annotation && { annotations : annotation } ) ,
174+ ...( annotations && { annotations } ) ,
175175 ...( _meta && { _meta } ) ,
176176 } ;
177177
Original file line number Diff line number Diff line change @@ -328,7 +328,7 @@ describe("MCPServer Tools", () => {
328328
329329 it ( "both methods work with tools that have annotations" , ( ) => {
330330 const toolName = "annotated-tool" ;
331- const annotation = {
331+ const annotations = {
332332 title : "Annotated Tool" ,
333333 readOnlyHint : true ,
334334 destructiveHint : false ,
@@ -346,16 +346,16 @@ describe("MCPServer Tools", () => {
346346 content : [ { type : "text" , text : "annotation test" } ] ,
347347 isError : false ,
348348 } ) ,
349- annotation ,
349+ annotations ,
350350 } ) ;
351351
352352 // Test getTool
353353 const singleTool = server . getTool ( toolName ) ;
354- expect ( singleTool ?. annotations ) . toEqual ( annotation ) ;
354+ expect ( singleTool ?. annotations ) . toEqual ( annotations ) ;
355355
356356 // Test getTools
357357 const allTools = server . getTools ( ) ;
358- expect ( allTools . get ( toolName ) ?. annotations ) . toEqual ( annotation ) ;
358+ expect ( allTools . get ( toolName ) ?. annotations ) . toEqual ( annotations ) ;
359359 } ) ;
360360
361361 it ( "both methods work with tools that have _meta" , ( ) => {
Original file line number Diff line number Diff line change @@ -18,6 +18,6 @@ export interface ToolConfig<
1818 handler : ( params : ParsedData < V > ) => Promise < R > | R ;
1919 description ?: string ;
2020 outputSchema ?: Tool [ "outputSchema" ] ;
21- annotation ?: Tool [ "annotations" ] ;
21+ annotations ?: Tool [ "annotations" ] ;
2222 _meta ?: Tool [ "_meta" ] ;
2323}
You can’t perform that action at this time.
0 commit comments