MCP Tools¶
AgentComms provides MCP (Model Context Protocol) tools that AI assistants can use for communication.
Voice Tools¶
These tools enable phone calls via Twilio.
initiate_call¶
Start a new call to the user.
Input:
Output:
When to use:
- Reporting significant task completion
- Requesting urgent clarification when blocked
- Discussing complex decisions
- Walking through code changes
continue_call¶
Continue an active call with another message.
Input:
{
"call_id": "call-1-1234567890",
"message": "I added authentication using JWT. Should I also add refresh tokens?"
}
Output:
speak_to_user¶
Speak without waiting for a response.
Input:
{
"call_id": "call-1-1234567890",
"message": "Let me search for that in the codebase. Give me a moment..."
}
Output:
When to use:
- Acknowledgments before time-consuming operations
- Status updates during a call
end_call¶
End the call with an optional goodbye message.
Input:
Output:
Chat Tools¶
These tools enable messaging via Discord, Telegram, and WhatsApp.
send_message¶
Send a message to a chat channel.
Input:
{
"provider": "discord",
"chat_id": "123456789",
"message": "I've finished the PR! Here's the link: https://github.com/...",
"reply_to": "optional_message_id"
}
Output:
Provider options: discord, telegram, whatsapp
list_channels¶
List available chat channels and their status.
Input:
Output:
{
"channels": [
{"provider_name": "discord", "status": "connected"},
{"provider_name": "telegram", "status": "connected"}
]
}
get_messages¶
Get recent messages from a chat conversation.
Input:
Output:
{
"messages": [
{
"id": "msg_123",
"content": "Can you also add unit tests?",
"author": "user123",
"timestamp": "2024-01-15T10:30:00Z"
}
]
}
Inbound Tools¶
These tools allow AI to check for messages sent by humans via the daemon.
Requires Daemon
These tools require the agentcomms daemon to be running.
Start it with agentcomms daemon.
check_messages¶
Check for new messages sent to this agent from humans via chat.
Input:
Output:
{
"messages": [
{
"id": "evt_01ABC123",
"channel_id": "discord:123456789",
"provider": "discord",
"text": "Hey, can you also add unit tests?",
"timestamp": "2024-01-15T10:30:00Z",
"type": "human_message"
}
],
"agent_id": "claude",
"has_more": false,
"last_seen_id": "evt_01ABC123"
}
When to use:
- Periodically during long-running tasks
- After completing a subtask
- When waiting for build/test results
Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
agent_id |
string | env var or "default" | Agent to check messages for |
limit |
int | 10 | Maximum messages to return |
get_agent_events¶
Get all recent events for an agent (messages, interrupts, status changes).
Input:
Output:
{
"events": [
{
"id": "evt_01ABC456",
"agent_id": "claude",
"channel_id": "discord:123456789",
"type": "human_message",
"role": "human",
"timestamp": "2024-01-15T10:35:00Z",
"status": "delivered",
"payload": {"text": "Thanks!"}
}
],
"agent_id": "claude"
}
Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
agent_id |
string | env var or "default" | Agent to get events for |
since_id |
string | (none) | Only return events after this ID |
limit |
int | 20 | Maximum events to return |
daemon_status¶
Check if the agentcomms daemon is running.
Input:
Output (running):
{
"running": true,
"started_at": "2024-01-15T09:00:00Z",
"agents": 1,
"providers": ["discord", "telegram"]
}
Output (not running):
Agent ID Resolution¶
The inbound tools need to know which agent to query. Resolution order:
agent_idparameter in the tool callAGENTCOMMS_AGENT_IDenvironment variable- Default:
"default"
Set the environment variable in your MCP server configuration:
{
"mcpServers": {
"agentcomms": {
"command": "/path/to/agentcomms",
"env": {
"AGENTCOMMS_AGENT_ID": "claude"
}
}
}
}
Usage Patterns¶
Polling During Long Tasks¶
1. Start long-running operation
2. Every few minutes, call check_messages
3. If messages found, process them
4. Continue operation
Responding to Messages¶
1. Call check_messages
2. Read message from human
3. Process the request
4. Call send_message to respond