Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions crates/rmcp-macros/src/tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,9 @@ pub fn tool(attr: TokenStream, input: TokenStream) -> syn::Result<TokenStream> {
rmcp::handler::server::common::cached_schema_for_type::<#params_ty>()
})?
} else {
// if not found, use the default EmptyObject schema
// if not found, use a simple empty JSON object
syn::parse2::<Expr>(quote! {
rmcp::handler::server::common::cached_schema_for_type::<rmcp::model::EmptyObject>()
std::sync::Arc::new(serde_json::Map::new())
})?
}
};
Expand Down
2 changes: 1 addition & 1 deletion crates/rmcp/tests/test_tool_macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ async fn test_tool_macros() {
async fn test_tool_macros_with_empty_param() {
let _attr = Server::empty_param_tool_attr();
println!("{_attr:?}");
assert_eq!(_attr.input_schema.get("type").unwrap(), "object");
assert!(_attr.input_schema.get("type").is_none());
assert!(_attr.input_schema.get("properties").is_none());
}

Expand Down