A high-performance mathematical and logical expression evaluation server.
For a better experience with interactive examples, schemas, and testing capabilities, visit:
The interactive documentation includes request/response examples, schema validation, and a "try it out" feature.
Server health check and statistics
Evaluate expressions via JSON POST request
{
"expression": "=2 + 3 * 4",
"arguments": {"x": 10, "y": 20},
"output_json": true
}
Upload and validate JavaScript functions
⚠️ Requires admin token authentication
{
"filename": "myfunction.js",
"js_code": "// @name: MYFUNCTION\n// @min_args: 1\n// @max_args: 1\n// @example: MYFUNCTION(5) returns 10\nfunction execute(args) { return args[0] * 2; }"
}
List all JavaScript functions in hooks directory
Returns detailed information about each function including validation status
⚠️ Requires admin token authentication
Update an existing JavaScript function
⚠️ Requires admin token authentication
{
"filename": "myfunction.js",
"js_code": "// @name: MYFUNCTION\n// @min_args: 1\n// @max_args: 1\n// @example: MYFUNCTION(10) returns 20\nfunction execute(args) { return args[0] * 2; }"
}
Delete a JavaScript function file
⚠️ Requires admin token authentication
{
"filename": "myfunction.js"
}
Reload all JavaScript functions from hooks directory
⚠️ Requires admin token authentication
{}
# Health check
curl http://localhost:5074/health
# Simple evaluation
curl -X POST http://localhost:5074/eval \
-H "Content-Type: application/json" \
-d '{"expression": "=2 + 3 * 4"}'
# With variables
curl -X POST http://localhost:5074/eval \
-H "Content-Type: application/json" \
-d '{"expression": "=:x + :y", "arguments": {"x": 10, "y": 20}}'
# JavaScript function management (requires admin token)
# List all JS functions
curl -H "Authorization: admin456" http://localhost:5074/list-js
# Upload a JS function
curl -X POST http://localhost:5074/upload-js \
-H "Content-Type: application/json" \
-H "Authorization: admin456" \
-d '{"filename": "double.js", "js_code": "// @name: DOUBLE\n// @example: DOUBLE(5) returns 10\nfunction execute(args) { return args[0] * 2; }"}'
# Update a JS function
curl -X PUT http://localhost:5074/update-js \
-H "Content-Type: application/json" \
-H "Authorization: admin456" \
-d '{"filename": "double.js", "js_code": "// @name: DOUBLE\n// @example: DOUBLE(5) returns 20\nfunction execute(args) { return args[0] * 4; }"}'
# Delete a JS function
curl -X DELETE http://localhost:5074/delete-js \
-H "Content-Type: application/json" \
-H "Authorization: admin456" \
-d '{"filename": "double.js"}'
# Reload hooks
curl -X POST http://localhost:5074/reload-hooks \
-H "Content-Type: application/json" \
-H "Authorization: admin456" \
-d '{}'