feat(model): add ServerConfig and ClientConfig (#1266)
This commit is contained in:
parent
fbfc5cc96e
commit
165ff92df1
2 changed files with 331 additions and 303 deletions
|
|
@ -217,8 +217,8 @@ pub fn tool_router(attr: TokenStream, input: TokenStream) -> TokenStream {
|
|||
/// ```rust,ignore
|
||||
/// #[tool_handler]
|
||||
/// impl ServerHandler for MyToolHandler {
|
||||
/// fn get_info(&self) -> InitializeResult {
|
||||
/// InitializeResult::new(ServerCapabilities::builder().enable_tools().build())
|
||||
/// fn get_info(&self) -> ServerConfig {
|
||||
/// ServerConfig::new(ServerCapabilities::builder().enable_tools().build())
|
||||
/// }
|
||||
/// }
|
||||
/// ```
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ pub(crate) enum CallerCapability {
|
|||
Prompts,
|
||||
}
|
||||
|
||||
/// Build a `get_info()` method that returns `InitializeResult` with the appropriate capabilities.
|
||||
/// Build a `get_info()` method that returns `ServerConfig` with the appropriate capabilities.
|
||||
///
|
||||
/// The caller declares its own capability via `caller`. Sibling handler attributes
|
||||
/// (`prompt_handler`, `tool_handler`) are detected automatically
|
||||
|
|
@ -157,8 +157,8 @@ pub(crate) fn build_get_info(
|
|||
}
|
||||
|
||||
syn::parse2::<ImplItem>(quote! {
|
||||
fn get_info(&self) -> rmcp::model::InitializeResult {
|
||||
rmcp::model::InitializeResult::new(
|
||||
fn get_info(&self) -> rmcp::model::ServerConfig {
|
||||
rmcp::model::ServerConfig::new(
|
||||
rmcp::model::ServerCapabilities::builder()
|
||||
#(#capability_calls)*
|
||||
.build()
|
||||
|
|
|
|||
Loading…
Reference in a new issue