(tools: Array<AnyTool>)
| 89 | * Schemas before calling, the same way harness adapters advertise tools). |
| 90 | */ |
| 91 | export function toolDescriptors(tools: Array<AnyTool>): Array<ToolDescriptor> { |
| 92 | return tools.map((tool) => ({ |
| 93 | name: tool.name, |
| 94 | description: tool.description, |
| 95 | inputSchema: isJsonSchemaObject(tool.inputSchema) |
| 96 | ? tool.inputSchema |
| 97 | : { type: 'object', properties: {} }, |
| 98 | })) |
| 99 | } |
| 100 | |
| 101 | function isJsonSchemaObject( |
| 102 | value: unknown, |
no test coverage detected