runTool: async()

in runtimes/runtimes/agent.ts [44:55]


        runTool: async (toolName: string, input: any, token?: CancellationToken, updates?: WritableStream) => {
            const tool = tools[toolName]
            if (!tool) {
                throw new Error(`Tool ${toolName} not found`)
            }

            if (!tool.validate(input, token)) {
                throw new Error(`Input for tool ${toolName} is invalid`)
            }

            return tool.invoke(input, token, updates)
        },