| 9 | |
| 10 | // Minimal tool definition for testing buildTool |
| 11 | function makeMinimalToolDef(overrides: Record<string, unknown> = {}) { |
| 12 | return { |
| 13 | name: 'TestTool', |
| 14 | inputSchema: { type: 'object' as const } as any, |
| 15 | maxResultSizeChars: 10000, |
| 16 | call: async () => ({ data: 'ok' }), |
| 17 | description: async () => 'A test tool', |
| 18 | prompt: async () => 'test prompt', |
| 19 | mapToolResultToToolResultBlockParam: ( |
| 20 | content: unknown, |
| 21 | toolUseID: string, |
| 22 | ) => ({ |
| 23 | type: 'tool_result' as const, |
| 24 | tool_use_id: toolUseID, |
| 25 | content: String(content), |
| 26 | }), |
| 27 | renderToolUseMessage: () => null, |
| 28 | ...overrides, |
| 29 | } |
| 30 | } |
| 31 | |
| 32 | describe('buildTool', () => { |
| 33 | test('fills in default isEnabled as true', () => { |