chore: fix all clippy warnings across workspace (#746)
This commit is contained in:
parent
3bd7522070
commit
8700e5c920
8 changed files with 743 additions and 793 deletions
|
|
@ -12,7 +12,6 @@ edition = "2024"
|
||||||
version = "1.2.0"
|
version = "1.2.0"
|
||||||
authors = ["4t145 <u4t145@163.com>"]
|
authors = ["4t145 <u4t145@163.com>"]
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
license-file = "LICENSE"
|
|
||||||
repository = "https://github.com/modelcontextprotocol/rust-sdk/"
|
repository = "https://github.com/modelcontextprotocol/rust-sdk/"
|
||||||
description = "Rust SDK for Model Context Protocol"
|
description = "Rust SDK for Model Context Protocol"
|
||||||
keywords = ["mcp", "sdk", "tokio", "modelcontextprotocol"]
|
keywords = ["mcp", "sdk", "tokio", "modelcontextprotocol"]
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
use std::future::Future;
|
|
||||||
|
|
||||||
use rmcp::{
|
use rmcp::{
|
||||||
ClientHandler, ErrorData, RoleClient, ServiceExt,
|
ClientHandler, ErrorData, RoleClient, ServiceExt,
|
||||||
model::*,
|
model::*,
|
||||||
|
|
@ -55,12 +53,11 @@ impl ClientHandler for ElicitationDefaultsClientHandler {
|
||||||
info
|
info
|
||||||
}
|
}
|
||||||
|
|
||||||
fn create_elicitation(
|
async fn create_elicitation(
|
||||||
&self,
|
&self,
|
||||||
request: CreateElicitationRequestParams,
|
request: CreateElicitationRequestParams,
|
||||||
_cx: RequestContext<RoleClient>,
|
_cx: RequestContext<RoleClient>,
|
||||||
) -> impl Future<Output = Result<CreateElicitationResult, ErrorData>> + Send + '_ {
|
) -> Result<CreateElicitationResult, ErrorData> {
|
||||||
async move {
|
|
||||||
let content = match &request {
|
let content = match &request {
|
||||||
CreateElicitationRequestParams::FormElicitationParams {
|
CreateElicitationRequestParams::FormElicitationParams {
|
||||||
requested_schema, ..
|
requested_schema, ..
|
||||||
|
|
@ -99,18 +96,14 @@ impl ClientHandler for ElicitationDefaultsClientHandler {
|
||||||
EnumSchema::Multi(MultiSelectEnumSchema::Untitled(u)) => {
|
EnumSchema::Multi(MultiSelectEnumSchema::Untitled(u)) => {
|
||||||
u.default.as_ref().map(|d| {
|
u.default.as_ref().map(|d| {
|
||||||
Value::Array(
|
Value::Array(
|
||||||
d.iter()
|
d.iter().map(|s| Value::String(s.clone())).collect(),
|
||||||
.map(|s| Value::String(s.clone()))
|
|
||||||
.collect(),
|
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
EnumSchema::Multi(MultiSelectEnumSchema::Titled(t)) => {
|
EnumSchema::Multi(MultiSelectEnumSchema::Titled(t)) => {
|
||||||
t.default.as_ref().map(|d| {
|
t.default.as_ref().map(|d| {
|
||||||
Value::Array(
|
Value::Array(
|
||||||
d.iter()
|
d.iter().map(|s| Value::String(s.clone())).collect(),
|
||||||
.map(|s| Value::String(s.clone()))
|
|
||||||
.collect(),
|
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -131,7 +124,6 @@ impl ClientHandler for ElicitationDefaultsClientHandler {
|
||||||
content,
|
content,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A client handler that handles both sampling and elicitation
|
/// A client handler that handles both sampling and elicitation
|
||||||
|
|
@ -149,12 +141,11 @@ impl ClientHandler for FullClientHandler {
|
||||||
info
|
info
|
||||||
}
|
}
|
||||||
|
|
||||||
fn create_message(
|
async fn create_message(
|
||||||
&self,
|
&self,
|
||||||
params: CreateMessageRequestParams,
|
params: CreateMessageRequestParams,
|
||||||
_cx: RequestContext<RoleClient>,
|
_cx: RequestContext<RoleClient>,
|
||||||
) -> impl Future<Output = Result<CreateMessageResult, ErrorData>> + Send + '_ {
|
) -> Result<CreateMessageResult, ErrorData> {
|
||||||
async move {
|
|
||||||
let prompt_text = params
|
let prompt_text = params
|
||||||
.messages
|
.messages
|
||||||
.first()
|
.first()
|
||||||
|
|
@ -174,20 +165,17 @@ impl ClientHandler for FullClientHandler {
|
||||||
)
|
)
|
||||||
.with_stop_reason("endTurn"))
|
.with_stop_reason("endTurn"))
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
fn create_elicitation(
|
async fn create_elicitation(
|
||||||
&self,
|
&self,
|
||||||
_request: CreateElicitationRequestParams,
|
_request: CreateElicitationRequestParams,
|
||||||
_cx: RequestContext<RoleClient>,
|
_cx: RequestContext<RoleClient>,
|
||||||
) -> impl Future<Output = Result<CreateElicitationResult, ErrorData>> + Send + '_ {
|
) -> Result<CreateElicitationResult, ErrorData> {
|
||||||
async move {
|
|
||||||
Ok(CreateElicitationResult {
|
Ok(CreateElicitationResult {
|
||||||
action: ElicitationAction::Accept,
|
action: ElicitationAction::Accept,
|
||||||
content: Some(json!({"username": "testuser", "email": "test@example.com"})),
|
content: Some(json!({"username": "testuser", "email": "test@example.com"})),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ─── OAuth helpers ──────────────────────────────────────────────────────────
|
// ─── OAuth helpers ──────────────────────────────────────────────────────────
|
||||||
|
|
@ -761,9 +749,7 @@ fn build_tool_arguments(tool: &Tool) -> Option<serde_json::Map<String, Value>> {
|
||||||
})
|
})
|
||||||
.unwrap_or_default();
|
.unwrap_or_default();
|
||||||
|
|
||||||
let Some(properties) = properties else {
|
let properties = properties?;
|
||||||
return None;
|
|
||||||
};
|
|
||||||
if properties.is_empty() && required.is_empty() {
|
if properties.is_empty() && required.is_empty() {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
use std::{collections::HashSet, future::Future, sync::Arc};
|
use std::{collections::HashSet, sync::Arc};
|
||||||
|
|
||||||
use rmcp::{
|
use rmcp::{
|
||||||
ErrorData, RoleServer, ServerHandler,
|
ErrorData, RoleServer, ServerHandler,
|
||||||
|
|
@ -42,12 +42,11 @@ impl ConformanceServer {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ServerHandler for ConformanceServer {
|
impl ServerHandler for ConformanceServer {
|
||||||
fn initialize(
|
async fn initialize(
|
||||||
&self,
|
&self,
|
||||||
_request: InitializeRequestParams,
|
_request: InitializeRequestParams,
|
||||||
_cx: RequestContext<RoleServer>,
|
_cx: RequestContext<RoleServer>,
|
||||||
) -> impl Future<Output = Result<InitializeResult, ErrorData>> + Send + '_ {
|
) -> Result<InitializeResult, ErrorData> {
|
||||||
async {
|
|
||||||
Ok(InitializeResult::new(
|
Ok(InitializeResult::new(
|
||||||
ServerCapabilities::builder()
|
ServerCapabilities::builder()
|
||||||
.enable_prompts()
|
.enable_prompts()
|
||||||
|
|
@ -59,21 +58,16 @@ impl ServerHandler for ConformanceServer {
|
||||||
.with_server_info(Implementation::new("rust-conformance-server", "0.1.0"))
|
.with_server_info(Implementation::new("rust-conformance-server", "0.1.0"))
|
||||||
.with_instructions("Rust MCP conformance test server"))
|
.with_instructions("Rust MCP conformance test server"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async fn ping(&self, _cx: RequestContext<RoleServer>) -> Result<(), ErrorData> {
|
||||||
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn ping(
|
async fn list_tools(
|
||||||
&self,
|
|
||||||
_cx: RequestContext<RoleServer>,
|
|
||||||
) -> impl Future<Output = Result<(), ErrorData>> + Send + '_ {
|
|
||||||
async { Ok(()) }
|
|
||||||
}
|
|
||||||
|
|
||||||
fn list_tools(
|
|
||||||
&self,
|
&self,
|
||||||
_request: Option<PaginatedRequestParams>,
|
_request: Option<PaginatedRequestParams>,
|
||||||
_cx: RequestContext<RoleServer>,
|
_cx: RequestContext<RoleServer>,
|
||||||
) -> impl Future<Output = Result<ListToolsResult, ErrorData>> + Send + '_ {
|
) -> Result<ListToolsResult, ErrorData> {
|
||||||
async {
|
|
||||||
let tools = vec![
|
let tools = vec![
|
||||||
Tool::new(
|
Tool::new(
|
||||||
"test_simple_text",
|
"test_simple_text",
|
||||||
|
|
@ -214,14 +208,12 @@ impl ServerHandler for ConformanceServer {
|
||||||
next_cursor: None,
|
next_cursor: None,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
fn call_tool(
|
async fn call_tool(
|
||||||
&self,
|
&self,
|
||||||
request: CallToolRequestParams,
|
request: CallToolRequestParams,
|
||||||
cx: RequestContext<RoleServer>,
|
cx: RequestContext<RoleServer>,
|
||||||
) -> impl Future<Output = Result<CallToolResult, ErrorData>> + Send + '_ {
|
) -> Result<CallToolResult, ErrorData> {
|
||||||
async move {
|
|
||||||
let args = request.arguments.unwrap_or_default();
|
let args = request.arguments.unwrap_or_default();
|
||||||
match request.name.as_ref() {
|
match request.name.as_ref() {
|
||||||
"test_simple_text" => Ok(CallToolResult::success(vec![Content::text(
|
"test_simple_text" => Ok(CallToolResult::success(vec![Content::text(
|
||||||
|
|
@ -234,7 +226,6 @@ impl ServerHandler for ConformanceServer {
|
||||||
)])),
|
)])),
|
||||||
|
|
||||||
"test_audio_content" => {
|
"test_audio_content" => {
|
||||||
// No Content::audio() helper, construct manually
|
|
||||||
let audio = RawContent::Audio(RawAudioContent {
|
let audio = RawContent::Audio(RawAudioContent {
|
||||||
data: TEST_AUDIO_DATA.into(),
|
data: TEST_AUDIO_DATA.into(),
|
||||||
mime_type: "audio/wav".into(),
|
mime_type: "audio/wav".into(),
|
||||||
|
|
@ -544,14 +535,12 @@ impl ServerHandler for ConformanceServer {
|
||||||
)),
|
)),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
fn list_resources(
|
async fn list_resources(
|
||||||
&self,
|
&self,
|
||||||
_request: Option<PaginatedRequestParams>,
|
_request: Option<PaginatedRequestParams>,
|
||||||
_cx: RequestContext<RoleServer>,
|
_cx: RequestContext<RoleServer>,
|
||||||
) -> impl Future<Output = Result<ListResourcesResult, ErrorData>> + Send + '_ {
|
) -> Result<ListResourcesResult, ErrorData> {
|
||||||
async {
|
|
||||||
Ok(ListResourcesResult {
|
Ok(ListResourcesResult {
|
||||||
meta: None,
|
meta: None,
|
||||||
resources: vec![
|
resources: vec![
|
||||||
|
|
@ -581,14 +570,12 @@ impl ServerHandler for ConformanceServer {
|
||||||
next_cursor: None,
|
next_cursor: None,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
fn read_resource(
|
async fn read_resource(
|
||||||
&self,
|
&self,
|
||||||
request: ReadResourceRequestParams,
|
request: ReadResourceRequestParams,
|
||||||
_cx: RequestContext<RoleServer>,
|
_cx: RequestContext<RoleServer>,
|
||||||
) -> impl Future<Output = Result<ReadResourceResult, ErrorData>> + Send + '_ {
|
) -> Result<ReadResourceResult, ErrorData> {
|
||||||
async move {
|
|
||||||
let uri = request.uri.as_str();
|
let uri = request.uri.as_str();
|
||||||
match uri {
|
match uri {
|
||||||
"test://static-text" => Ok(ReadResourceResult::new(vec![
|
"test://static-text" => Ok(ReadResourceResult::new(vec![
|
||||||
|
|
@ -608,7 +595,6 @@ impl ServerHandler for ConformanceServer {
|
||||||
},
|
},
|
||||||
])),
|
])),
|
||||||
_ => {
|
_ => {
|
||||||
// Check if it matches template: test://template/{id}/data
|
|
||||||
if uri.starts_with("test://template/") && uri.ends_with("/data") {
|
if uri.starts_with("test://template/") && uri.ends_with("/data") {
|
||||||
let id = uri
|
let id = uri
|
||||||
.strip_prefix("test://template/")
|
.strip_prefix("test://template/")
|
||||||
|
|
@ -634,14 +620,12 @@ impl ServerHandler for ConformanceServer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
fn list_resource_templates(
|
async fn list_resource_templates(
|
||||||
&self,
|
&self,
|
||||||
_request: Option<PaginatedRequestParams>,
|
_request: Option<PaginatedRequestParams>,
|
||||||
_cx: RequestContext<RoleServer>,
|
_cx: RequestContext<RoleServer>,
|
||||||
) -> impl Future<Output = Result<ListResourceTemplatesResult, ErrorData>> + Send + '_ {
|
) -> Result<ListResourceTemplatesResult, ErrorData> {
|
||||||
async {
|
|
||||||
Ok(ListResourceTemplatesResult {
|
Ok(ListResourceTemplatesResult {
|
||||||
meta: None,
|
meta: None,
|
||||||
resource_templates: vec![
|
resource_templates: vec![
|
||||||
|
|
@ -658,38 +642,32 @@ impl ServerHandler for ConformanceServer {
|
||||||
next_cursor: None,
|
next_cursor: None,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
fn subscribe(
|
async fn subscribe(
|
||||||
&self,
|
&self,
|
||||||
request: SubscribeRequestParams,
|
request: SubscribeRequestParams,
|
||||||
_cx: RequestContext<RoleServer>,
|
_cx: RequestContext<RoleServer>,
|
||||||
) -> impl Future<Output = Result<(), ErrorData>> + Send + '_ {
|
) -> Result<(), ErrorData> {
|
||||||
async move {
|
|
||||||
let mut subs = self.subscriptions.lock().await;
|
let mut subs = self.subscriptions.lock().await;
|
||||||
subs.insert(request.uri.to_string());
|
subs.insert(request.uri.to_string());
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
fn unsubscribe(
|
async fn unsubscribe(
|
||||||
&self,
|
&self,
|
||||||
request: UnsubscribeRequestParams,
|
request: UnsubscribeRequestParams,
|
||||||
_cx: RequestContext<RoleServer>,
|
_cx: RequestContext<RoleServer>,
|
||||||
) -> impl Future<Output = Result<(), ErrorData>> + Send + '_ {
|
) -> Result<(), ErrorData> {
|
||||||
async move {
|
|
||||||
let mut subs = self.subscriptions.lock().await;
|
let mut subs = self.subscriptions.lock().await;
|
||||||
subs.remove(request.uri.as_str());
|
subs.remove(request.uri.as_str());
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
fn list_prompts(
|
async fn list_prompts(
|
||||||
&self,
|
&self,
|
||||||
_request: Option<PaginatedRequestParams>,
|
_request: Option<PaginatedRequestParams>,
|
||||||
_cx: RequestContext<RoleServer>,
|
_cx: RequestContext<RoleServer>,
|
||||||
) -> impl Future<Output = Result<ListPromptsResult, ErrorData>> + Send + '_ {
|
) -> Result<ListPromptsResult, ErrorData> {
|
||||||
async {
|
|
||||||
Ok(ListPromptsResult {
|
Ok(ListPromptsResult {
|
||||||
meta: None,
|
meta: None,
|
||||||
prompts: vec![
|
prompts: vec![
|
||||||
|
|
@ -724,14 +702,12 @@ impl ServerHandler for ConformanceServer {
|
||||||
next_cursor: None,
|
next_cursor: None,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
fn get_prompt(
|
async fn get_prompt(
|
||||||
&self,
|
&self,
|
||||||
request: GetPromptRequestParams,
|
request: GetPromptRequestParams,
|
||||||
_cx: RequestContext<RoleServer>,
|
_cx: RequestContext<RoleServer>,
|
||||||
) -> impl Future<Output = Result<GetPromptResult, ErrorData>> + Send + '_ {
|
) -> Result<GetPromptResult, ErrorData> {
|
||||||
async move {
|
|
||||||
match request.name.as_str() {
|
match request.name.as_str() {
|
||||||
"test_simple_prompt" => Ok(GetPromptResult::new(vec![PromptMessage::new_text(
|
"test_simple_prompt" => Ok(GetPromptResult::new(vec![PromptMessage::new_text(
|
||||||
PromptMessageRole::User,
|
PromptMessageRole::User,
|
||||||
|
|
@ -787,14 +763,12 @@ impl ServerHandler for ConformanceServer {
|
||||||
)),
|
)),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
fn complete(
|
async fn complete(
|
||||||
&self,
|
&self,
|
||||||
request: CompleteRequestParams,
|
request: CompleteRequestParams,
|
||||||
_cx: RequestContext<RoleServer>,
|
_cx: RequestContext<RoleServer>,
|
||||||
) -> impl Future<Output = Result<CompleteResult, ErrorData>> + Send + '_ {
|
) -> Result<CompleteResult, ErrorData> {
|
||||||
async move {
|
|
||||||
let values = match &request.r#ref {
|
let values = match &request.r#ref {
|
||||||
Reference::Resource(_) => {
|
Reference::Resource(_) => {
|
||||||
if request.argument.name == "id" {
|
if request.argument.name == "id" {
|
||||||
|
|
@ -817,19 +791,16 @@ impl ServerHandler for ConformanceServer {
|
||||||
CompletionInfo::new(values).map_err(|e| ErrorData::internal_error(e, None))?,
|
CompletionInfo::new(values).map_err(|e| ErrorData::internal_error(e, None))?,
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
fn set_level(
|
async fn set_level(
|
||||||
&self,
|
&self,
|
||||||
request: SetLevelRequestParams,
|
request: SetLevelRequestParams,
|
||||||
_cx: RequestContext<RoleServer>,
|
_cx: RequestContext<RoleServer>,
|
||||||
) -> impl Future<Output = Result<(), ErrorData>> + Send + '_ {
|
) -> Result<(), ErrorData> {
|
||||||
async move {
|
|
||||||
let mut level = self.log_level.lock().await;
|
let mut level = self.log_level.lock().await;
|
||||||
*level = request.level;
|
*level = request.level;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "rmcp-macros"
|
name = "rmcp-macros"
|
||||||
license = { workspace = true }
|
license = { workspace = true }
|
||||||
license-file = { workspace = true }
|
|
||||||
version = { workspace = true }
|
version = { workspace = true }
|
||||||
edition = { workspace = true }
|
edition = { workspace = true }
|
||||||
repository = { workspace = true }
|
repository = { workspace = true }
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "rmcp"
|
name = "rmcp"
|
||||||
license = { workspace = true }
|
license = { workspace = true }
|
||||||
license-file = { workspace = true }
|
|
||||||
version = { workspace = true }
|
version = { workspace = true }
|
||||||
edition = { workspace = true }
|
edition = { workspace = true }
|
||||||
repository = { workspace = true }
|
repository = { workspace = true }
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ use rmcp::transport::{
|
||||||
StreamableHttpServerConfig,
|
StreamableHttpServerConfig,
|
||||||
streamable_http_server::{session::local::LocalSessionManager, tower::StreamableHttpService},
|
streamable_http_server::{session::local::LocalSessionManager, tower::StreamableHttpService},
|
||||||
};
|
};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::Deserialize;
|
||||||
use serde_json::Value;
|
use serde_json::Value;
|
||||||
use tokio::sync::RwLock;
|
use tokio::sync::RwLock;
|
||||||
use tower_http::cors::{Any, CorsLayer};
|
use tower_http::cors::{Any, CorsLayer};
|
||||||
|
|
@ -35,8 +35,8 @@ const BIND_ADDRESS: &str = "127.0.0.1:3000";
|
||||||
/// In-memory authorization code record
|
/// In-memory authorization code record
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
struct AuthCodeRecord {
|
struct AuthCodeRecord {
|
||||||
client_id: String,
|
_client_id: String,
|
||||||
redirect_uri: String,
|
_redirect_uri: String,
|
||||||
expires_at: SystemTime,
|
expires_at: SystemTime,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -368,8 +368,8 @@ async fn handle_authorize(
|
||||||
codes.insert(
|
codes.insert(
|
||||||
code.clone(),
|
code.clone(),
|
||||||
AuthCodeRecord {
|
AuthCodeRecord {
|
||||||
client_id: client_id_url,
|
_client_id: client_id_url,
|
||||||
redirect_uri: redirect_uri.to_string(),
|
_redirect_uri: redirect_uri.to_string(),
|
||||||
expires_at,
|
expires_at,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
#![allow(dead_code)]
|
#![allow(dead_code)]
|
||||||
use std::{any::Any, sync::Arc};
|
use std::{any::Any, sync::Arc};
|
||||||
|
|
||||||
use chrono::Utc;
|
|
||||||
use rmcp::{
|
use rmcp::{
|
||||||
ErrorData as McpError, RoleServer, ServerHandler,
|
ErrorData as McpError, RoleServer, ServerHandler,
|
||||||
handler::server::{
|
handler::server::{
|
||||||
|
|
@ -12,14 +11,11 @@ use rmcp::{
|
||||||
prompt, prompt_handler, prompt_router, schemars,
|
prompt, prompt_handler, prompt_router, schemars,
|
||||||
service::RequestContext,
|
service::RequestContext,
|
||||||
task_handler,
|
task_handler,
|
||||||
task_manager::{
|
task_manager::{OperationProcessor, OperationResultTransport},
|
||||||
OperationDescriptor, OperationMessage, OperationProcessor, OperationResultTransport,
|
|
||||||
},
|
|
||||||
tool, tool_handler, tool_router,
|
tool, tool_handler, tool_router,
|
||||||
};
|
};
|
||||||
use serde_json::json;
|
use serde_json::json;
|
||||||
use tokio::sync::Mutex;
|
use tokio::sync::Mutex;
|
||||||
use tracing::info;
|
|
||||||
|
|
||||||
struct ToolCallOperationResult {
|
struct ToolCallOperationResult {
|
||||||
id: String,
|
id: String,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue