MCPcopy Create free account
hub / github.com/Noumena-Network/code / callTool

Function callTool

src/tools/REPLTool/javascriptReplFactory.tsx:257–266  ·  view source on GitHub ↗
(name: string, args?: Record<string, unknown>)

Source from the content-addressed store, hash-verified

255 const globals = replContext.vmContext as Record<string, unknown>
256
257 const callTool = async (name: string, args?: Record<string, unknown>) => {
258 if (typeof name !== 'string' || name.trim() === '') {
259 throw new Error('callTool(name, args) requires a non-empty tool name')
260 }
261 const tool = replContext.registeredTools.get(name)
262 if (!tool) {
263 throw new Error(`Unknown JavaScript REPL tool: ${name}`)
264 }
265 return tool.handler(ensureRecord(args))
266 }
267
268 const listTools = () =>
269 [...replContext.registeredTools.values()].map(tool => ({

Callers

nothing calls this directly

Calls 2

ensureRecordFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected