import { Groq } from 'groq-sdk';

const client = new Groq();
const MODEL = 'openai/gpt-oss-20b';

function calculate(expression) {
    try {
        // Note: Using this method to evaluate expressions in JavaScript can be dangerous.
        // In a production environment, you should use a safer alternative.
        const result = new Function(`return ${expression}`)();
        return JSON.stringify({ result });
    } catch {
        return JSON.stringify({ error: "Invalid expression" });
    }
}

---

## Define the tool schema