MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / useMergedTools

Function useMergedTools

source code/hooks/useMergedTools.ts:22–46  ·  view source on GitHub ↗
(
  initialTools: Tools,
  mcpTools: Tools,
  toolPermissionContext: ToolPermissionContext,
)

Source from the content-addressed store, hash-verified

20 * @param toolPermissionContext - Permission context for filtering
21 */
22export function useMergedTools(
23 initialTools: Tools,
24 mcpTools: Tools,
25 toolPermissionContext: ToolPermissionContext,
26): Tools {
27 let replBridgeEnabled = false
28 let replBridgeOutboundOnly = false
29 return useMemo(() => {
30 // assembleToolPool is the shared function that both REPL and runAgent use.
31 // It handles: getTools() + MCP deny-rule filtering + dedup + MCP CLI exclusion.
32 const assembled = assembleToolPool(toolPermissionContext, mcpTools)
33
34 return mergeAndFilterTools(
35 initialTools,
36 assembled,
37 toolPermissionContext.mode,
38 )
39 }, [
40 initialTools,
41 mcpTools,
42 toolPermissionContext,
43 replBridgeEnabled,
44 replBridgeOutboundOnly,
45 ])
46}

Callers 2

AgentsMenuFunction · 0.85
REPLFunction · 0.85

Calls 2

assembleToolPoolFunction · 0.85
mergeAndFilterToolsFunction · 0.85

Tested by

no test coverage detected