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 {
8181 this . update = ( updates : { name ?: string ; description ?: string ; inputSchema ?: AnyZodObject } ) => {
8282 const tools = server [ "_registeredTools" ] as { [ toolName : string ] : RegisteredTool } ;
8383 const existingTool = tools [ this . name ] ;
84+ existingTool . annotations = this . annotations ;
8485
8586 if ( updates . name && updates . name !== this . name ) {
87+ existingTool . annotations . title = updates . name ;
8688 delete tools [ this . name ] ;
8789 this . name = updates . name ;
8890 tools [ this . name ] = existingTool ;
8991 }
9092
9193 if ( updates . description ) {
94+ existingTool . annotations . description = updates . description ;
9295 existingTool . description = updates . description ;
9396 this . description = updates . description ;
9497 }
Original file line number Diff line number Diff line change @@ -206,6 +206,9 @@ export function validateToolMetadata(
206206 expectDefined ( tool ) ;
207207 expect ( tool . description ) . toBe ( description ) ;
208208
209+ expectDefined ( tool . annotations ) ;
210+ // expect(tool.annotations.title).toBe(name);
211+ expect ( tool . annotations . description ) . toBe ( description ) ;
209212 const toolParameters = getParameters ( tool ) ;
210213 expect ( toolParameters ) . toHaveLength ( parameters . length ) ;
211214 expect ( toolParameters ) . toIncludeAllMembers ( parameters ) ;
You can’t perform that action at this time.
0 commit comments