TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/sipeed/picoclaw/llms.txt
Use this file to discover all available pages before exploring further.
message tool allows agents to send messages directly to users on various chat platforms.
message
Send a message to a user on a chat channel.Parameters
The message content to send.
Optional target channel (e.g., “telegram”, “whatsapp”, “discord”). If not specified, uses the current conversation’s channel.
Optional target chat or user ID. If not specified, uses the current conversation’s chat ID.
Returns
Silent confirmation:
"Message sent to {channel}:{chat_id}"The result is marked as silent since the user already receives the message directly.Usage Example
Context Management
The message tool uses conversation context to determine the default recipient:channeldefaults to the conversation’s channelchat_iddefaults to the conversation’s chat ID
Override Context
Explicitly specify different channel/chat:Send Tracking
The message tool tracks whether messages were sent in the current processing round:SetContext() is called for a new processing round.
Callback Integration
The message tool uses a callback function to deliver messages:Callback Requirements
- channel: Platform identifier (“telegram”, “whatsapp”, etc.)
- chatID: Unique identifier for the chat or user
- content: Message text to send
- Returns: Error if sending fails
Error Handling
Missing Content
Missing Context
- No context was set via
SetContext() channelorchat_idnot provided in parameters
Callback Not Configured
Send Failure
Use Cases
Progress Updates
Task Completion
Alerts & Notifications
Multi-user Notifications
Send to multiple recipients:Best Practices
1. Use for Important Updates
Send messages for:- Task completion
- Error conditions
- Progress milestones
- Time-sensitive alerts
2. Format for Readability
3. Include Context
4. Use Emojis Sparingly
5. Handle Failures Gracefully
Implement retry logic in the callback:Integration with Other Tools
With Cron Tool
With Spawn Tool
Platform Support
The message tool is platform-agnostic. Supported channels depend on your callback implementation:- Telegram
- Discord
- Slack
- IRC
- CLI (direct output)
- Custom platforms
SendCallback for your target platform.