MCPcopy
hub / github.com/shareAI-lab/learn-claude-code / assemble_tool_pool

Function assemble_tool_pool

s19_mcp_plugin/code.py:754–770  ·  view source on GitHub ↗

Assemble builtin tools + all MCP tools into one pool.

()

Source from the content-addressed store, hash-verified

752
753
754def assemble_tool_pool() -> tuple[list[dict], dict]:
755 """Assemble builtin tools + all MCP tools into one pool."""
756 tools = list(BUILTIN_TOOLS)
757 handlers = dict(BUILTIN_HANDLERS)
758 for server_name, mcp_client in mcp_clients.items():
759 safe_server = normalize_mcp_name(server_name)
760 for tool_def in mcp_client.tools:
761 safe_tool = normalize_mcp_name(tool_def["name"])
762 prefixed = f"mcp__{safe_server}__{safe_tool}"
763 tools.append({
764 "name": prefixed,
765 "description": tool_def.get("description", ""),
766 "input_schema": tool_def.get("inputSchema", {}),
767 })
768 handlers[prefixed] = (
769 lambda *, c=mcp_client, t=tool_def["name"], **kw: c.call_tool(t, kw))
770 return tools, handlers
771
772
773# ── Lead Worktree Tools ──

Callers 1

agent_loopFunction · 0.70

Calls 3

normalize_mcp_nameFunction · 0.70
getMethod · 0.45
call_toolMethod · 0.45

Tested by

no test coverage detected