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

Function call

source code/utils/computerUse/wrapper.tsx:251–284  ·  view source on GitHub ↗
(args, context: ToolUseContext)

Source from the content-addressed store, hash-verified

249};
250export function getComputerUseMCPToolOverrides(toolName: string): ComputerUseMCPToolOverrides {
251 const call: CallOverride = async (args, context: ToolUseContext) => {
252 currentToolUseContext = context;
253 const {
254 dispatch
255 } = getOrBind();
256 const {
257 telemetry,
258 ...result
259 } = await dispatch(toolName, args);
260 if (telemetry?.error_kind) {
261 logForDebugging(`[Computer Use MCP] ${toolName} error_kind=${telemetry.error_kind}`);
262 }
263
264 // MCP content blocks → Anthropic API blocks. CU only produces text and
265 // pre-sized JPEG (executor.ts computeTargetDims → targetImageSize), so
266 // unlike the generic MCP path there's no resize needed — the MCP image
267 // shape just maps to the API's base64-source shape. The package's result
268 // type admits audio/resource too, but CU's handleToolCall never emits
269 // those; the fallthrough coerces them to empty text.
270 const data = Array.isArray(result.content) ? result.content.map(item => item.type === 'image' ? {
271 type: 'image' as const,
272 source: {
273 type: 'base64' as const,
274 media_type: item.mimeType ?? 'image/jpeg',
275 data: item.data
276 }
277 } : {
278 type: 'text' as const,
279 text: item.type === 'text' ? item.text : ''
280 }) : result.content;
281 return {
282 data
283 };
284 };
285 return {
286 ...getComputerUseMCPRenderingOverrides(toolName),
287 call

Callers

nothing calls this directly

Calls 2

getOrBindFunction · 0.85
logForDebuggingFunction · 0.85

Tested by

no test coverage detected