Checkpoint before assistant change: Improved a math calculator

Updated the prompt for a math calculator agent to clarify instructions and fix a JSON formatting issue in `attached_assets/Pasted--Math-Calculator-Ready-Available-operations-add-multiply-divide-Example-add-5-and-3-or-mu-1745164485767.txt`.  The update resolves an error in tool execution.

Replit-Commit-Author: Assistant
pull/819/head
DP37 3 months ago committed by ascender1729
parent 9e23325f3c
commit c490e82e34

@ -0,0 +1,62 @@
Math Calculator Ready!
Available operations: add, multiply, divide
Example: 'add 5 and 3' or 'multiply 4 by 6'
Type 'exit' to quit
Enter math operation: add 3 and334
╭─────────────────────────────── Agent Name Math Agent [Max Loops: 1 ] ────────────────────────────────╮
│ Math Agent: {"tool_name": "add", "a": 3, "b": 334} │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────╯
2025-04-20 15:54:35 | ERROR | swarms.tools.mcp_integration:_call_one_server:475 - Error calling server: ClientSession.__init__() missing 2 required positional arguments: 'read_stream' and 'write_stream'
╭─────────────────────── Agent Name Math Agent - Tool Executor [Max Loops: 1 ] ────────────────────────╮
│ Math Agent - Tool Executor: No result from tool execution │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─────────────────────── Agent Name Math Agent - Agent Analysis [Max Loops: 1 ] ───────────────────────╮
│ Math Agent - Agent Analysis: {"error": "No result from tool execution"} │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────╯
Result: System: : Your Name: Math Agent
Your Description: Basic math calculator
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
Available tools and their JSON formats:
- Addition: {"tool_name": "add", "a": <number>, "b": <number>}
- Multiplication: {"tool_name": "multiply", "a": <number>, "b": <number>}
- Division: {"tool_name": "divide", "a": <number>, "b": <number>}
IMPORTANT:
1. Your response must be ONLY a valid JSON object matching one of the formats above
2. Do not include any additional text, explanations, or formatting
3. Convert all numbers to integers
4. Do not include any markdown, code blocks, or other formatting
Example interaction:
User: "add 5 and 3"
You: {"tool_name": "add", "a": 5, "b": 3}
Remember to use the available MCP tools for calculations rather than doing them directly.
Human:: add 3 and334
Math Agent: {"tool_name": "add", "a": 3, "b": 334}
error: No result from tool execution
Tool Executor: No result from tool execution
Math Agent: {"error": "No result from tool execution"}
Enter math operation:
Loading…
Cancel
Save