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

Function buildRequiresActionDetails

source code/cli/structuredIO.ts:95–119  ·  view source on GitHub ↗
(
  tool: Tool,
  input: Record<string, unknown>,
  toolUseID: string,
  requestId: string,
)

Source from the content-addressed store, hash-verified

93}
94
95function buildRequiresActionDetails(
96 tool: Tool,
97 input: Record<string, unknown>,
98 toolUseID: string,
99 requestId: string,
100): RequiresActionDetails {
101 // Per-tool summary methods may throw on malformed input; permission
102 // handling must not break because of a bad description.
103 let description: string
104 try {
105 description =
106 tool.getActivityDescription?.(input) ??
107 tool.getToolUseSummary?.(input) ??
108 tool.userFacingName(input)
109 } catch {
110 description = tool.name
111 }
112 return {
113 tool_name: tool.name,
114 action_description: description,
115 tool_use_id: toolUseID,
116 request_id: requestId,
117 input,
118 }
119}
120
121type PendingRequest<T> = {
122 resolve: (result: T) => void

Callers 1

createCanUseToolMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected