MCPcopy Create free account
hub / github.com/ClickHouse/ai-sdk-cpp / send_email

Function send_email

examples/tool_calling_multistep.cpp:77–90  ·  view source on GitHub ↗

Tool: Send email notification

Source from the content-addressed store, hash-verified

75
76// Tool: Send email notification
77ai::JsonValue send_email(const ai::JsonValue& args,
78 const ai::ToolExecutionContext& context) {
79 std::string to = args["to"].get<std::string>();
80 std::string subject = args["subject"].get<std::string>();
81 std::string body = args["body"].get<std::string>();
82
83 std::cout << "📧 Sending email to: " << to << std::endl;
84 std::cout << " Subject: " << subject << std::endl;
85
86 // Simulate email sending
87 return ai::JsonValue{{"status", "sent"},
88 {"message_id", "msg_" + std::to_string(std::rand())},
89 {"recipient", to}};
90}
91
92// Tool: Get city recommendations
93ai::JsonValue get_recommendations(const ai::JsonValue& args,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected