add caldav mcp server

refactoring
This commit is contained in:
milan
2026-05-03 18:28:20 +02:00
parent 20a5b01311
commit 3dd897c422
14 changed files with 1342 additions and 97 deletions
+16 -11
View File
@@ -221,19 +221,24 @@ impl AgentChat {
log::debug!("calling tool {}", tool_call.function.name);
let result = self.call_tool(tool_call, &mut permission_request_callback).await?;
let contents = match result {
Some(result) => result.content
.iter()
.filter_map(|content| content.as_text())
.map(|text_content| text_content.text.clone())
.collect::<Vec<_>>(),
None => vec![String::from("Tool Permission Denied by the user")],
};
// serialize structured content if it exists
if let Some(structured_content) = result.clone().and_then(|result|result.structured_content) {
self.message_history.push(ChatMessage::tool(structured_content.to_string()));
} else {
let contents = match result {
Some(result) => result.content
.iter()
.filter_map(|content| content.as_text())
.map(|text_content| text_content.text.clone())
.collect::<Vec<_>>(),
None => vec![String::from("Tool Permission Denied by the user")],
};
log::debug!("contents: {:#?}", contents);
log::debug!("contents: {:#?}", contents);
self.message_history
.push(ChatMessage::tool(contents.join("\n")));
self.message_history
.push(ChatMessage::tool(contents.join("\n")));
}
}
response = self