Optional map of tool names to definitions. Returns [] when falsy.
Flat array of normalised ITool instances ready for provider dispatch.
const tools = adaptTools({
getWeather: {
description: 'Returns current weather for a city.',
parameters: { type: 'object', properties: { city: { type: 'string' } }, required: ['city'] },
execute: async ({ city }) => fetchWeather(city),
},
});
Converts supported tool inputs into an array of
IToolinstances suitable for use with the AgentOS provider layer.IToolinstances (identified byinputSchema+idproperties) are passed through unchanged.ToolDefinitionobjects are wrapped in a minimalIToolimplementation. Zod schemas are converted to JSON Schema whenzod-to-json-schemais available.IToolinstances, preserving any prompt metadata they expose.ToolDefinitionForLLM[]arrays are treated as prompt-only schemas and produce tools that fail explicitly when invoked without an executor.