| 12 | * - think, plan, reportWarning, getConfirm |
| 13 | */ |
| 14 | export function createThinkingTools() { |
| 15 | return { |
| 16 | calculate: tool({ |
| 17 | description: |
| 18 | 'Perform mathematical calculations with precision. Use this for any arithmetic operations instead of calculating yourself. Supports basic operators: +, -, *, /, (), decimals.', |
| 19 | inputSchema: z.object({ |
| 20 | expression: z |
| 21 | .string() |
| 22 | .describe( |
| 23 | 'Mathematical expression to evaluate, e.g. "100 / 50000", "(1000 * 0.1) / 2"', |
| 24 | ), |
| 25 | }).meta({ examples: [{ expression: '(1000 * 0.1) / 2' }] }), |
| 26 | execute: ({ expression }) => { |
| 27 | return calculate(expression); |
| 28 | }, |
| 29 | }), |
| 30 | }; |
| 31 | } |