@@ -411,7 +411,7 @@ impl<Counterpart: Role> ConnectTo<role::mcp::Client> for McpServerConnection<Cou
411411impl < R : Role > ServerHandler for McpServerConnection < R > {
412412 async fn call_tool (
413413 & self ,
414- request : rmcp:: model:: CallToolRequestParam ,
414+ request : rmcp:: model:: CallToolRequestParams ,
415415 context : rmcp:: service:: RequestContext < rmcp:: RoleServer > ,
416416 ) -> Result < CallToolResult , ErrorData > {
417417 // Lookup the tool definition, erroring if not found or disabled
@@ -467,7 +467,7 @@ impl<R: Role> ServerHandler for McpServerConnection<R> {
467467
468468 async fn list_tools (
469469 & self ,
470- _request : Option < rmcp:: model:: PaginatedRequestParam > ,
470+ _request : Option < rmcp:: model:: PaginatedRequestParams > ,
471471 _context : rmcp:: service:: RequestContext < rmcp:: RoleServer > ,
472472 ) -> Result < rmcp:: model:: ListToolsResult , ErrorData > {
473473 // Return only enabled tools
@@ -483,13 +483,18 @@ impl<R: Role> ServerHandler for McpServerConnection<R> {
483483
484484 fn get_info ( & self ) -> rmcp:: model:: ServerInfo {
485485 // Basic server info
486- rmcp:: model:: ServerInfo {
487- protocol_version : rmcp:: model:: ProtocolVersion :: default ( ) ,
488- capabilities : rmcp:: model:: ServerCapabilities :: builder ( )
486+ let base = rmcp:: model:: ServerInfo :: new (
487+ rmcp:: model:: ServerCapabilities :: builder ( )
489488 . enable_tools ( )
490489 . build ( ) ,
491- server_info : rmcp:: model:: Implementation :: default ( ) ,
492- instructions : self . data . instructions . clone ( ) ,
490+ )
491+ . with_server_info ( rmcp:: model:: Implementation :: default ( ) )
492+ . with_protocol_version ( rmcp:: model:: ProtocolVersion :: default ( ) ) ;
493+
494+ if let Some ( instr) = self . data . instructions . clone ( ) {
495+ base. with_instructions ( instr)
496+ } else {
497+ base
493498 }
494499 }
495500}
@@ -505,18 +510,20 @@ trait ErasedMcpTool<Counterpart: Role>: Send + Sync {
505510
506511/// Create an `rmcp` tool model from our [`McpTool`] trait.
507512fn make_tool_model < R : Role , M : McpTool < R > > ( tool : & M ) -> Tool {
508- rmcp:: model:: Tool {
509- name : tool. name ( ) . into ( ) ,
510- title : tool. title ( ) ,
511- description : Some ( tool. description ( ) . into ( ) ) ,
512- input_schema : schema_for_type :: < M :: Input > ( ) ,
513+ {
514+ rmcp:: model:: Tool :: new (
515+ tool. name ( ) ,
516+ tool. description ( ) ,
517+ schema_for_type :: < M :: Input > ( ) ,
518+ )
513519 // schema_for_output returns Err for non-object types (strings, integers, etc.)
514520 // since MCP structured output requires JSON objects. We use .ok() to set
515521 // output_schema to None for these tools, signaling unstructured output.
516- output_schema : schema_for_output :: < M :: Output > ( ) . ok ( ) ,
517- annotations : None ,
518- icons : None ,
519- meta : None ,
522+ . with_raw_output_schema ( schema_for_output :: < M :: Output > ( ) . ok ( ) )
523+ . with_annotations ( None )
524+ . with_icons ( None )
525+ . with_meta ( None )
526+ . with_execution ( Some ( rmcp:: model:: ToolExecution :: new ( ) ) )
520527 }
521528}
522529
0 commit comments