MCPcopy Create free account
hub / github.com/AGenUI/AGenUI / registerFunctionCall

Method registerFunctionCall

core/src/function_call/agenui_functioncall_manager.cpp:22–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20}
21
22bool FunctionCallManager::registerFunctionCall(const FunctionCallConfig& config, IPlatformFunction* function) {
23 if (!config.isValid()) {
24 AGENUI_LOG("invalid config");
25 return false;
26 }
27 if (!function) {
28 AGENUI_LOG("function is null");
29 return false;
30 }
31
32 std::lock_guard<std::recursive_mutex> lock(_mutex);
33
34 FunctionCallEntry entry;
35 entry.config = config;
36 entry.function = function;
37
38 // Register by short name so lookups use "toast" rather than "agenui.platform::toast"
39 const std::string& name = config.getName();
40 std::string fullName = config.getFullName();
41 _functionCalls[name] = entry;
42
43 return true;
44}
45
46bool FunctionCallManager::unregisterFunctionCall(const std::string& name) {
47 std::lock_guard<std::recursive_mutex> lock(_mutex);

Callers 3

registerFunctionMethod · 0.80
initFunctionCallsMethod · 0.80
TESTFunction · 0.80

Calls 3

isValidMethod · 0.45
getNameMethod · 0.45
getFullNameMethod · 0.45

Tested by 1

TESTFunction · 0.64