@@ -236,6 +236,7 @@ async def list_tools(self) -> list[MCPTool]:
236236 return [
237237 MCPTool (
238238 name = info .name ,
239+ title = info .title ,
239240 description = info .description ,
240241 inputSchema = info .parameters ,
241242 annotations = info .annotations ,
@@ -269,6 +270,7 @@ async def list_resources(self) -> list[MCPResource]:
269270 MCPResource (
270271 uri = resource .uri ,
271272 name = resource .name or "" ,
273+ title = resource .title ,
272274 description = resource .description ,
273275 mimeType = resource .mime_type ,
274276 )
@@ -281,6 +283,7 @@ async def list_resource_templates(self) -> list[MCPResourceTemplate]:
281283 MCPResourceTemplate (
282284 uriTemplate = template .uri_template ,
283285 name = template .name ,
286+ title = template .title ,
284287 description = template .description ,
285288 )
286289 for template in templates
@@ -304,6 +307,7 @@ def add_tool(
304307 self ,
305308 fn : AnyFunction ,
306309 name : str | None = None ,
310+ title : str | None = None ,
307311 description : str | None = None ,
308312 annotations : ToolAnnotations | None = None ,
309313 ) -> None :
@@ -315,14 +319,16 @@ def add_tool(
315319 Args:
316320 fn: The function to register as a tool
317321 name: Optional name for the tool (defaults to function name)
322+ title: Optional human-readable title for the tool
318323 description: Optional description of what the tool does
319324 annotations: Optional ToolAnnotations providing additional tool information
320325 """
321- self ._tool_manager .add_tool (fn , name = name , description = description , annotations = annotations )
326+ self ._tool_manager .add_tool (fn , name = name , title = title , description = description , annotations = annotations )
322327
323328 def tool (
324329 self ,
325330 name : str | None = None ,
331+ title : str | None = None ,
326332 description : str | None = None ,
327333 annotations : ToolAnnotations | None = None ,
328334 ) -> Callable [[AnyFunction ], AnyFunction ]:
@@ -334,6 +340,7 @@ def tool(
334340
335341 Args:
336342 name: Optional name for the tool (defaults to function name)
343+ title: Optional human-readable title for the tool
337344 description: Optional description of what the tool does
338345 annotations: Optional ToolAnnotations providing additional tool information
339346
@@ -359,7 +366,7 @@ async def async_tool(x: int, context: Context) -> str:
359366 )
360367
361368 def decorator (fn : AnyFunction ) -> AnyFunction :
362- self .add_tool (fn , name = name , description = description , annotations = annotations )
369+ self .add_tool (fn , name = name , title = title , description = description , annotations = annotations )
363370 return fn
364371
365372 return decorator
@@ -377,6 +384,7 @@ def resource(
377384 uri : str ,
378385 * ,
379386 name : str | None = None ,
387+ title : str | None = None ,
380388 description : str | None = None ,
381389 mime_type : str | None = None ,
382390 ) -> Callable [[AnyFunction ], AnyFunction ]:
@@ -394,6 +402,7 @@ def resource(
394402 Args:
395403 uri: URI for the resource (e.g. "resource://my-resource" or "resource://{param}")
396404 name: Optional name for the resource
405+ title: Optional human-readable title for the resource
397406 description: Optional description of the resource
398407 mime_type: Optional MIME type for the resource
399408
@@ -443,6 +452,7 @@ def decorator(fn: AnyFunction) -> AnyFunction:
443452 fn = fn ,
444453 uri_template = uri ,
445454 name = name ,
455+ title = title ,
446456 description = description ,
447457 mime_type = mime_type ,
448458 )
@@ -452,6 +462,7 @@ def decorator(fn: AnyFunction) -> AnyFunction:
452462 fn = fn ,
453463 uri = uri ,
454464 name = name ,
465+ title = title ,
455466 description = description ,
456467 mime_type = mime_type ,
457468 )
@@ -468,11 +479,14 @@ def add_prompt(self, prompt: Prompt) -> None:
468479 """
469480 self ._prompt_manager .add_prompt (prompt )
470481
471- def prompt (self , name : str | None = None , description : str | None = None ) -> Callable [[AnyFunction ], AnyFunction ]:
482+ def prompt (
483+ self , name : str | None = None , title : str | None = None , description : str | None = None
484+ ) -> Callable [[AnyFunction ], AnyFunction ]:
472485 """Decorator to register a prompt.
473486
474487 Args:
475488 name: Optional name for the prompt (defaults to function name)
489+ title: Optional human-readable title for the prompt
476490 description: Optional description of what the prompt does
477491
478492 Example:
@@ -510,7 +524,7 @@ async def analyze_file(path: str) -> list[Message]:
510524 )
511525
512526 def decorator (func : AnyFunction ) -> AnyFunction :
513- prompt = Prompt .from_function (func , name = name , description = description )
527+ prompt = Prompt .from_function (func , name = name , title = title , description = description )
514528 self .add_prompt (prompt )
515529 return func
516530
@@ -812,6 +826,7 @@ async def list_prompts(self) -> list[MCPPrompt]:
812826 return [
813827 MCPPrompt (
814828 name = prompt .name ,
829+ title = prompt .title ,
815830 description = prompt .description ,
816831 arguments = [
817832 MCPPromptArgument (
0 commit comments