MCPcopy
hub / github.com/codeaashu/claude-code / useMergedTools

Function useMergedTools

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

Source from the content-addressed store, hash-verified

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

Callers 2

AgentsMenuFunction · 0.85
REPLFunction · 0.85

Calls 2

assembleToolPoolFunction · 0.85
mergeAndFilterToolsFunction · 0.85

Tested by

no test coverage detected