( name: TName, description = 'A test tool', )
| 9 | import type { ToolBinding, ToolExecutionContext } from '../src/types' |
| 10 | |
| 11 | function createMockServerTool<TName extends string>( |
| 12 | name: TName, |
| 13 | description = 'A test tool', |
| 14 | ) { |
| 15 | const def = toolDefinition({ |
| 16 | name, |
| 17 | description, |
| 18 | inputSchema: z.object({ query: z.string() }), |
| 19 | outputSchema: z.object({ result: z.string() }), |
| 20 | }) |
| 21 | return def.server(async (input) => ({ |
| 22 | result: `response to ${input.query}`, |
| 23 | })) |
| 24 | } |
| 25 | |
| 26 | describe('toolToBinding', () => { |
| 27 | it('converts ServerTool to ToolBinding with correct fields', () => { |
no test coverage detected