MCPcopy Create free account
hub / github.com/claude-code-best/claude-code / wrappedCanUseTool

Method wrappedCanUseTool

src/QueryEngine.ts:253–281  ·  view source on GitHub ↗
(
      tool,
      input,
      toolUseContext,
      assistantMessage,
      toolUseID,
      forceDecision,
    )

Source from the content-addressed store, hash-verified

251
252 // Wrap canUseTool to track permission denials
253 const wrappedCanUseTool: CanUseToolFn = async (
254 tool,
255 input,
256 toolUseContext,
257 assistantMessage,
258 toolUseID,
259 forceDecision,
260 ) => {
261 const result = await canUseTool(
262 tool,
263 input,
264 toolUseContext,
265 assistantMessage,
266 toolUseID,
267 forceDecision,
268 )
269
270 // Track denials for SDK reporting
271 if (result.behavior !== 'allow') {
272 this.permissionDenials.push({
273 type: 'permission_denial',
274 tool_name: sdkCompatToolName(tool.name),
275 tool_use_id: toolUseID,
276 tool_input: input,
277 })
278 }
279
280 return result
281 }
282
283 const initialAppState = getAppState()
284 const initialMainLoopModel = userSpecifiedModel

Callers

nothing calls this directly

Calls 3

sdkCompatToolNameFunction · 0.85
canUseToolFunction · 0.50
pushMethod · 0.45

Tested by

no test coverage detected