From 802a489805ff594b0d6319586e458942a5d4ee0b Mon Sep 17 00:00:00 2001 From: Pavan Kumar <66913595+ascender1729@users.noreply.github.com> Date: Sun, 20 Apr 2025 09:24:56 +0000 Subject: [PATCH] fix(mcp): update server setup and add missing math agent prompt definition --- examples/mcp_example/mock_math_server.py | 3 ++- swarms/prompts/agent_prompts.py | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/examples/mcp_example/mock_math_server.py b/examples/mcp_example/mock_math_server.py index c5f51d90..07803d84 100644 --- a/examples/mcp_example/mock_math_server.py +++ b/examples/mcp_example/mock_math_server.py @@ -1,3 +1,4 @@ + from fastmcp import FastMCP mcp = FastMCP("Math-Mock-Server") @@ -21,4 +22,4 @@ def divide(a: int, b: int) -> float: if __name__ == "__main__": print("Starting Mock Math Server on port 8000...") - mcp.run(transport="sse", host="0.0.0.0", port=8000) \ No newline at end of file + mcp.run(transport="sse", port=8000) diff --git a/swarms/prompts/agent_prompts.py b/swarms/prompts/agent_prompts.py index 1453fb93..3a921a14 100644 --- a/swarms/prompts/agent_prompts.py +++ b/swarms/prompts/agent_prompts.py @@ -10,6 +10,15 @@ Key responsibilities: Remember to use the available MCP tools for calculations rather than doing them directly.""" +MATH_AGENT_PROMPT = """You are a specialized math agent that can perform calculations by calling external math service APIs. +Key responsibilities: +1. Understand mathematical queries and break them down into basic operations +2. Use available math tools (add, multiply, divide) appropriately +3. Provide clear explanations of calculations +4. Handle errors gracefully if operations fail + +Remember to use the available MCP tools for calculations rather than doing them directly.""" + FINANCE_AGENT_PROMPT = """You are a financial analysis agent with access to stock market data services. Key responsibilities: 1. Interpret financial queries and determine required data