File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -81,14 +81,17 @@ export abstract class ToolBase {
81
81
this . update = ( updates : { name ?: string ; description ?: string ; inputSchema ?: AnyZodObject } ) => {
82
82
const tools = server [ "_registeredTools" ] as { [ toolName : string ] : RegisteredTool } ;
83
83
const existingTool = tools [ this . name ] ;
84
+ existingTool . annotations = this . annotations ;
84
85
85
86
if ( updates . name && updates . name !== this . name ) {
87
+ existingTool . annotations . title = updates . name ;
86
88
delete tools [ this . name ] ;
87
89
this . name = updates . name ;
88
90
tools [ this . name ] = existingTool ;
89
91
}
90
92
91
93
if ( updates . description ) {
94
+ existingTool . annotations . description = updates . description ;
92
95
existingTool . description = updates . description ;
93
96
this . description = updates . description ;
94
97
}
Original file line number Diff line number Diff line change @@ -206,6 +206,9 @@ export function validateToolMetadata(
206
206
expectDefined ( tool ) ;
207
207
expect ( tool . description ) . toBe ( description ) ;
208
208
209
+ expectDefined ( tool . annotations ) ;
210
+ // expect(tool.annotations.title).toBe(name);
211
+ expect ( tool . annotations . description ) . toBe ( description ) ;
209
212
const toolParameters = getParameters ( tool ) ;
210
213
expect ( toolParameters ) . toHaveLength ( parameters . length ) ;
211
214
expect ( toolParameters ) . toIncludeAllMembers ( parameters ) ;
You can’t perform that action at this time.
0 commit comments