In the previous article, I showed how an autonomous agent can dynamically create and deploy arithmetic workflows (add
, sub
, mul
, div
, mod
, power
) into a LogicApp MCP server.
Now let’s test the MCP server in action — by solving real math problems with BODMAS rules.
🔢 The Setup
- MCP server = deployed LogicApp with arithmetic tools (
wf_arithmetic_add
,wf_arithmetic_mul
,wf_arithmetic_div
, etc). - MCP client = queries math expressions in natural language.
- The agent decomposes the expression into correct operations following BODMAS.
- The LogicApp tools are invoked step by step until the final answer is returned.
🧪 Example 1
Prompt:
could you help me with 10 + 50 * 25
Execution:
-
wf_arithmetic_mul
→ 50 * 25 = 1250 -
wf_arithmetic_add
→ 10 + 1250 = 1260
✅ Result: 1260
🧪 Example 2
Prompt:
calculate this for me 10 ^ 5 * 19 + (3 * 3 + 2)
Execution:
-
wf_arithmetic_pow
→ 10 ^ 5 = 100,000 -
wf_arithmetic_mul
→ 100,000 * 19 = 1,900,000 -
wf_arithmetic_mul
→ 3 * 3 = 9 -
wf_arithmetic_add
→ 9 + 2 = 11 -
wf_arithmetic_add
→ 1,900,000 + 11 = 1,900,011
✅ Result: 1,900,011
📸 Screenshot of MCP client running both examples
🎉 Why This Matters
This demonstrates how the LogicApp MCP server can act like a pluggable math engine:
- It follows BODMAS order by chaining the correct arithmetic workflows.
- MCP clients can simply ask in natural language, and the server runs the correct sequence.
- The same approach can scale beyond arithmetic — e.g., stored procedures, APIs, or business rules can be exposed as MCP tools and chained dynamically.
🔭 Next Steps
Arithmetic was just a demo.
Use the same pattern to publish real business logic as MCP tools:
- Expose database stored procedures and REST APIs as tools (handled the same way by
mcp_toolbuilder
) - Trigger tool creation via scheduler or webhook when new procs/endpoints appear
- Let MCP clients discover and use the new tools automatically
👉 Try it yourself and let me know how your MCP tools handle BODMAS in practice!
Top comments (0)