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

Function createToolStub

src/remote/remotePermissionBridge.ts:53–78  ·  view source on GitHub ↗
(toolName: string)

Source from the content-addressed store, hash-verified

51 * local CLI doesn't know about. The stub routes to FallbackPermissionRequest.
52 */
53export function createToolStub(toolName: string): Tool {
54 return {
55 name: toolName,
56 inputSchema: {} as Tool['inputSchema'],
57 isEnabled: () => true,
58 userFacingName: () => toolName,
59 renderToolUseMessage: (input: Record<string, unknown>) => {
60 const entries = Object.entries(input)
61 if (entries.length === 0) return ''
62 return entries
63 .slice(0, 3)
64 .map(([key, value]) => {
65 const valueStr =
66 typeof value === 'string' ? value : jsonStringify(value)
67 return `${key}: ${valueStr}`
68 })
69 .join(', ')
70 },
71 call: async () => ({ data: '' }),
72 description: async () => '',
73 prompt: () => '',
74 isReadOnly: () => false,
75 isMcp: false,
76 needsPermissions: () => true,
77 } as unknown as Tool
78}
79

Callers 3

useRemoteSessionFunction · 0.85
useSSHSessionFunction · 0.85
useDirectConnectFunction · 0.85

Calls 2

jsonStringifyFunction · 0.85
entriesMethod · 0.80

Tested by

no test coverage detected