feat: add tool annotations for build-in tools (#1939)

This commit is contained in:
Yingjie He
2025-03-31 16:46:55 -07:00
committed by GitHub
parent f184449f81
commit 680523297b
23 changed files with 369 additions and 9 deletions

View File

@@ -13,7 +13,7 @@ use mcp_core::{
prompt::Prompt,
protocol::ServerCapabilities,
resource::Resource,
tool::Tool,
tool::{Tool, ToolAnnotations},
Content,
};
use mcp_server::router::CapabilitiesBuilder;
@@ -74,6 +74,13 @@ impl ComputerControllerRouter {
}
}
}),
Some(ToolAnnotations {
title: Some("Web Scrape".to_string()),
read_only_hint: true,
destructive_hint: false,
idempotent_hint: false,
open_world_hint: true,
}),
);
let computer_control_desc = match std::env::consts::OS {
@@ -139,6 +146,7 @@ impl ComputerControllerRouter {
}
}
}),
None,
);
let quick_script_desc = match std::env::consts::OS {
@@ -189,6 +197,7 @@ impl ComputerControllerRouter {
}
}
}),
None,
);
let cache_tool = Tool::new(
@@ -215,6 +224,7 @@ impl ComputerControllerRouter {
}
}
}),
None,
);
let pdf_tool = Tool::new(
@@ -242,6 +252,13 @@ impl ComputerControllerRouter {
}
}
}),
Some(ToolAnnotations {
title: Some("PDF process".to_string()),
read_only_hint: true,
destructive_hint: false,
idempotent_hint: true,
open_world_hint: false,
}),
);
let docx_tool = Tool::new(
@@ -340,6 +357,7 @@ impl ComputerControllerRouter {
}
}
}),
None,
);
let make_presentation_tool = Tool::new(
@@ -380,6 +398,7 @@ impl ComputerControllerRouter {
}
}
}),
None,
);
let xlsx_tool = Tool::new(
@@ -441,6 +460,7 @@ impl ComputerControllerRouter {
}
}
}),
None,
);
// choose_app_strategy().cache_dir()