MCPcopy Create free account
hub / github.com/InternScience/InternAgent / register

Method register

internagent/mas/tools/tool_config.py:23–39  ·  view source on GitHub ↗

Register a functional tool Args: definition: Tool definition in OpenAI format function: Implementation function of the tool

(self, definition: Dict[str, Any], function: Callable)

Source from the content-addressed store, hash-verified

21 self._mcp_manager: Optional['MCPManager'] = None
22
23 def register(self, definition: Dict[str, Any], function: Callable) -> None:
24 """
25 Register a functional tool
26
27 Args:
28 definition: Tool definition in OpenAI format
29 function: Implementation function of the tool
30 """
31 tool_name = definition["function"]["name"]
32
33 if tool_name in self._functions:
34 logger.warning(f"Tool '{tool_name}' already registered, overwriting")
35
36 self._functions[tool_name] = function
37 self._definitions[tool_name] = definition
38
39 logger.info(f"Registered function tool: {tool_name}")
40
41 def set_mcp_manager(self, mcp_manager: 'MCPManager') -> None:
42 """

Callers 2

register_toolFunction · 0.45
buildMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected