it-tools-mcp 3.0.7 → 3.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/tools/math.js +4 -2
- package/package.json +1 -1
package/build/tools/math.js
CHANGED
|
@@ -5,9 +5,11 @@ export function registerMathTools(server) {
|
|
|
5
5
|
expression: z.string().describe("Mathematical expression to evaluate (e.g., '2 + 3 * 4')")
|
|
6
6
|
}, async ({ expression }) => {
|
|
7
7
|
try {
|
|
8
|
-
|
|
8
|
+
// @ts-ignore: Ignore missing type declarations for mathjs
|
|
9
|
+
const { compile } = await import("mathjs");
|
|
9
10
|
const start = Date.now();
|
|
10
|
-
const
|
|
11
|
+
const code = compile(expression);
|
|
12
|
+
const result = code.evaluate();
|
|
11
13
|
const elapsed = Date.now() - start;
|
|
12
14
|
return {
|
|
13
15
|
content: [
|