@@ -114,6 +114,7 @@ export class McpServer {
114114 ( [ name , tool ] ) : Tool => {
115115 const toolDefinition : Tool = {
116116 name,
117+ title : tool . title ,
117118 description : tool . description ,
118119 inputSchema : tool . inputSchema
119120 ? ( zodToJsonSchema ( tool . inputSchema , {
@@ -123,10 +124,6 @@ export class McpServer {
123124 annotations : tool . annotations ,
124125 } ;
125126
126- if ( tool . title !== undefined ) {
127- toolDefinition . title = tool . title ;
128- }
129-
130127 if ( tool . outputSchema ) {
131128 toolDefinition . outputSchema = zodToJsonSchema (
132129 tool . outputSchema ,
@@ -472,19 +469,14 @@ export class McpServer {
472469 ( [ , prompt ] ) => prompt . enabled ,
473470 ) . map (
474471 ( [ name , prompt ] ) : Prompt => {
475- const promptDefinition : Prompt = {
472+ return {
476473 name,
474+ title : prompt . title ,
477475 description : prompt . description ,
478476 arguments : prompt . argsSchema
479477 ? promptArgumentsFromSchema ( prompt . argsSchema )
480478 : undefined ,
481479 } ;
482-
483- if ( prompt . title !== undefined ) {
484- promptDefinition . title = prompt . title ;
485- }
486-
487- return promptDefinition ;
488480 } ,
489481 ) ,
490482 } ) ,
0 commit comments