MCPcopy Index your code
hub / github.com/claude-code-best/claude-code / useMergedTools

Function useMergedTools

src/hooks/useMergedTools.ts:19–43  ·  view source on GitHub ↗
(
  initialTools: Tools,
  mcpTools: Tools,
  toolPermissionContext: ToolPermissionContext,
)

Source from the content-addressed store, hash-verified

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

Callers 2

AgentsMenuFunction · 0.85
REPLFunction · 0.85

Calls 2

assembleToolPoolFunction · 0.85
mergeAndFilterToolsFunction · 0.85

Tested by

no test coverage detected