fix: generate default schema for tools with no params (#446)
* fix: generate default schema for tools with no params
This commit is contained in:
parent
57fc428c57
commit
717ec56e23
1 changed files with 14 additions and 4 deletions
|
|
@ -199,9 +199,13 @@ 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 a simple empty JSON object
|
||||
// if not found, use a default empty JSON schema object
|
||||
// TODO: should be updated according to the new specifications
|
||||
syn::parse2::<Expr>(quote! {
|
||||
std::sync::Arc::new(serde_json::Map::new())
|
||||
std::sync::Arc::new(serde_json::json!({
|
||||
"type": "object",
|
||||
"properties": {}
|
||||
}).as_object().unwrap().clone())
|
||||
})?
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue