Implementation of SEP-986: Specify Format for Tool Names (#551)
* feat: implement SEP-986 tool name validation and error reporting Adds validation for MCP tool naming conventions as specified in SEP-986. Ensures Rust SDK enforces standardized tool name formats, provides clear errors for invalid names, and improves consistency across implementations. Signed-off-by: tanish111 <tanishdesai37@gmail.com> * fix(doctests): correct import paths in tool_name_validation Update doctest examples to use the correct module path rmcp::handler::server::tool_name_validation instead of rmcp::model::tool_name_validation. Signed-off-by: tanish111 <tanishdesai37@gmail.com> * fix: only warn when warnings exist Prevent empty warnings array from triggering warning output. Signed-off-by: tanish111 <tanishdesai37@gmail.com> * fix: remove internal check Signed-off-by: tanish111 <tanishdesai37@gmail.com> * refactor: remove doc comments from validation functions Signed-off-by: tanish111 <tanishdesai37@gmail.com> * refactor: remove doc comments from add_route functions Signed-off-by: tanish111 <tanishdesai37@gmail.com> * refactor: make tool name validation helpers private Made ToolNameValidationResult and its functions and fields private. Made validate_tool_name and issue_tool_name_warning private. Signed-off-by: tanish111 <tanishdesai37@gmail.com> --------- Signed-off-by: tanish111 <tanishdesai37@gmail.com>
This commit is contained in:
parent
cf45070ce7
commit
97ef6c97e4
1 changed files with 268 additions and 3 deletions
|
|
@ -9,6 +9,7 @@ pub mod prompt;
|
|||
mod resource;
|
||||
pub mod router;
|
||||
pub mod tool;
|
||||
pub mod tool_name_validation;
|
||||
pub mod wrapper;
|
||||
impl<H: ServerHandler> Service<RoleServer> for H {
|
||||
async fn handle_request(
|
||||
|
|
|
|||
Loading…
Reference in a new issue