Simple Example: Daily Weather Report
Let’s create an agent that fetches weather data and sends a report.1
Create Agent Loop
Navigate to Agent Loops and click Create Agent Loop.
2
Name It
Name: “Daily Weather Reporter”
3
Write System Prompt
4
Set User Message
5
Add MCP Server
Add the HTTP Client MCP server so the agent can call weather APIs:
- Server Type: HTTP Client
- URL: (automatically configured)
6
Add Callback (Optional)
If you want to receive the report via webhook:
- Callback URL:
https://your-domain.com/weather-reports - Headers: Any authentication needed
7
Run
Click Create then Run to execute the agent loop.
What Happens
When you run the agent loop:- Agent Reads Instructions: Processes system prompt and user message
- Plans Approach: Decides to use HTTP tool to call weather API
- Calls Tool: Makes HTTP request to weather service
- Processes Response: Extracts temperature, conditions, forecast
- Generates Report: Creates formatted summary
- Sends Callback: Delivers report to your webhook (if configured)
- Completes: Marks execution as successful
Example Output
The agent might produce:More Complex Example: Database Report
Create an agent that queries a database and generates a report.1
Create Agent Loop
Name: “Daily Sales Report Generator”
2
System Prompt
3
User Message
4
Add Database MCP Server
(Coming soon - use HTTP to query API for now)
5
Configure Callback
Send results to your team’s Slack channel or email system.
Agent Loop Patterns
Pattern 1: Data Fetcher
Purpose: Retrieve data from external sources Components:- HTTP MCP server
- Clear data source instructions
- Output formatting guidelines
Pattern 2: Data Processor
Purpose: Transform or analyze data Components:- File system MCP server
- Processing instructions
- Output format specification
Pattern 3: Report Generator
Purpose: Create scheduled reports Components:- Data source access (HTTP/Database)
- Report template in system prompt
- Callback for delivery
Pattern 4: Monitoring Agent
Purpose: Check systems and alert on issues Components:- HTTP MCP for API checks
- Conditional logic in prompt
- Callback for alerts
Iterative Development
Agents use multiple reasoning steps:- Simple: 5 iterations
- Medium: 10 iterations
- Complex: 20+ iterations
Testing Your Agent
1
Start Simple
Begin with basic instructions and one tool.
2
Run Manually
Execute and review the output.
3
Check Logs
Review iteration logs to see reasoning process.
4
Refine Prompt
Adjust system prompt based on results.
5
Add Complexity
Gradually add more tools and steps.
6
Test Edge Cases
Try with different inputs and scenarios.
Common Mistakes
Vague Instructions
Bad:Too Many Tools
Problem: Providing unnecessary MCP servers confuses the agent. Solution: Only include tools needed for the specific task.Insufficient Iterations
Problem: Agent runs out of iterations before completing. Solution: Increase max iterations or simplify the task.No Error Handling
Problem: Agent fails when API returns an error. Solution: Include error handling instructions in system prompt:Best Practices
Explicit Steps
Break tasks into numbered steps in system prompt
Expected Output
Describe exactly what format you want
Error Handling
Tell the agent how to handle failures
Test Thoroughly
Run multiple times with different scenarios
Next Steps
MCP Servers
Learn about available tools
Callbacks
Set up result webhooks
API Reference
Trigger agents programmatically