@@ -237,6 +237,7 @@ async def list_tools(self) -> list[MCPTool]:
237237 return [
238238 MCPTool (
239239 name = info .name ,
240+ title = info .title ,
240241 description = info .description ,
241242 inputSchema = info .parameters ,
242243 annotations = info .annotations ,
@@ -270,6 +271,7 @@ async def list_resources(self) -> list[MCPResource]:
270271 MCPResource (
271272 uri = resource .uri ,
272273 name = resource .name or "" ,
274+ title = resource .title ,
273275 description = resource .description ,
274276 mimeType = resource .mime_type ,
275277 )
@@ -282,6 +284,7 @@ async def list_resource_templates(self) -> list[MCPResourceTemplate]:
282284 MCPResourceTemplate (
283285 uriTemplate = template .uri_template ,
284286 name = template .name ,
287+ title = template .title ,
285288 description = template .description ,
286289 )
287290 for template in templates
@@ -305,6 +308,7 @@ def add_tool(
305308 self ,
306309 fn : AnyFunction ,
307310 name : str | None = None ,
311+ title : str | None = None ,
308312 description : str | None = None ,
309313 annotations : ToolAnnotations | None = None ,
310314 ) -> None :
@@ -316,14 +320,16 @@ def add_tool(
316320 Args:
317321 fn: The function to register as a tool
318322 name: Optional name for the tool (defaults to function name)
323+ title: Optional human-readable title for the tool
319324 description: Optional description of what the tool does
320325 annotations: Optional ToolAnnotations providing additional tool information
321326 """
322- self ._tool_manager .add_tool (fn , name = name , description = description , annotations = annotations )
327+ self ._tool_manager .add_tool (fn , name = name , title = title , description = description , annotations = annotations )
323328
324329 def tool (
325330 self ,
326331 name : str | None = None ,
332+ title : str | None = None ,
327333 description : str | None = None ,
328334 annotations : ToolAnnotations | None = None ,
329335 ) -> Callable [[AnyFunction ], AnyFunction ]:
@@ -335,6 +341,7 @@ def tool(
335341
336342 Args:
337343 name: Optional name for the tool (defaults to function name)
344+ title: Optional human-readable title for the tool
338345 description: Optional description of what the tool does
339346 annotations: Optional ToolAnnotations providing additional tool information
340347
@@ -360,7 +367,7 @@ async def async_tool(x: int, context: Context) -> str:
360367 )
361368
362369 def decorator (fn : AnyFunction ) -> AnyFunction :
363- self .add_tool (fn , name = name , description = description , annotations = annotations )
370+ self .add_tool (fn , name = name , title = title , description = description , annotations = annotations )
364371 return fn
365372
366373 return decorator
@@ -396,6 +403,7 @@ def resource(
396403 uri : str ,
397404 * ,
398405 name : str | None = None ,
406+ title : str | None = None ,
399407 description : str | None = None ,
400408 mime_type : str | None = None ,
401409 ) -> Callable [[AnyFunction ], AnyFunction ]:
@@ -413,6 +421,7 @@ def resource(
413421 Args:
414422 uri: URI for the resource (e.g. "resource://my-resource" or "resource://{param}")
415423 name: Optional name for the resource
424+ title: Optional human-readable title for the resource
416425 description: Optional description of the resource
417426 mime_type: Optional MIME type for the resource
418427
@@ -462,6 +471,7 @@ def decorator(fn: AnyFunction) -> AnyFunction:
462471 fn = fn ,
463472 uri_template = uri ,
464473 name = name ,
474+ title = title ,
465475 description = description ,
466476 mime_type = mime_type ,
467477 )
@@ -471,6 +481,7 @@ def decorator(fn: AnyFunction) -> AnyFunction:
471481 fn = fn ,
472482 uri = uri ,
473483 name = name ,
484+ title = title ,
474485 description = description ,
475486 mime_type = mime_type ,
476487 )
@@ -487,11 +498,14 @@ def add_prompt(self, prompt: Prompt) -> None:
487498 """
488499 self ._prompt_manager .add_prompt (prompt )
489500
490- def prompt (self , name : str | None = None , description : str | None = None ) -> Callable [[AnyFunction ], AnyFunction ]:
501+ def prompt (
502+ self , name : str | None = None , title : str | None = None , description : str | None = None
503+ ) -> Callable [[AnyFunction ], AnyFunction ]:
491504 """Decorator to register a prompt.
492505
493506 Args:
494507 name: Optional name for the prompt (defaults to function name)
508+ title: Optional human-readable title for the prompt
495509 description: Optional description of what the prompt does
496510
497511 Example:
@@ -529,7 +543,7 @@ async def analyze_file(path: str) -> list[Message]:
529543 )
530544
531545 def decorator (func : AnyFunction ) -> AnyFunction :
532- prompt = Prompt .from_function (func , name = name , description = description )
546+ prompt = Prompt .from_function (func , name = name , title = title , description = description )
533547 self .add_prompt (prompt )
534548 return func
535549
@@ -831,6 +845,7 @@ async def list_prompts(self) -> list[MCPPrompt]:
831845 return [
832846 MCPPrompt (
833847 name = prompt .name ,
848+ title = prompt .title ,
834849 description = prompt .description ,
835850 arguments = [
836851 MCPPromptArgument (
0 commit comments