| name | metabot |
| description | MetaBot HTTP API for agent collaboration: talk to other bots, schedule tasks, manage bots and peers. Use when the user wants to delegate work to another bot, schedule tasks, create/remove bots, or check peer status. |
MetaBot API
MetaBot exposes an HTTP API for agent-to-agent collaboration, task scheduling, and bot management.
Your bot name and chat ID are provided in the system prompt (look for "You are running as bot ... in chat ..."). Use those values for botName and chatId in the commands below.
Quick Commands (mb shortcut)
The mb shell function is pre-installed and handles auth automatically. Prefer mb over raw curl:
mb bots
mb bot <name>
mb talk <botName> <chatId> <prompt>
mb talk alice/backend-bot <chatId> <prompt>
mb peers
mb schedule list
mb schedule add <bot> <chatId> <sec> <prompt>
mb schedule cancel <id>
mb schedule cron <bot> <chatId> '<cronExpr>' <prompt>
mb schedule pause <id>
mb schedule resume <id>
mb voice call <bot> <chatId> [prompt]
mb voice transcript <sessionId>
mb voice list
mb voice config
mb stats
mb metrics
mb health
Cross-Instance Agent Talk
When you talk to a bot that isn't on the local instance, MetaBot automatically routes the request to the peer instance that hosts that bot. No special syntax is needed — just use mb talk <botName> <chatId> <prompt> as usual.
Use qualified names to target a specific peer: mb talk <peerName>/<botName> <chatId> <prompt>.
Use mb bots to see all available bots including those on peer instances (they will have peerName and peerUrl fields indicating which instance hosts them).
API Reference (for complex operations)
For operations not covered by mb (creating bots, updating tasks, sendCards option), use the API directly.
Auth header: -H "Authorization: Bearer $METABOT_API_SECRET"
Base URL: !echo http://localhost:${METABOT_API_PORT:-9100}
Talk to a bot (primary endpoint):
curl -s -X POST http://localhost:${METABOT_API_PORT:-9100}/api/talk \
-H "Authorization: Bearer $METABOT_API_SECRET" \
-H "Content-Type: application/json" \
-d '{"botName":"<bot>","chatId":"<chatId>","prompt":"<message>","sendCards":true}'
The botName field supports qualified names: "alice/backend-bot" routes directly to the peer named "alice".
Create Feishu bot:
curl -s -X POST http://localhost:${METABOT_API_PORT:-9100}/api/bots \
-H "Authorization: Bearer $METABOT_API_SECRET" \
-H "Content-Type: application/json" \
-d '{"platform":"feishu","name":"<name>","feishuAppId":"...","feishuAppSecret":"...","defaultWorkingDirectory":"/path","installSkills":true}'
Create Telegram bot:
curl -s -X POST http://localhost:${METABOT_API_PORT:-9100}/api/bots \
-H "Authorization: Bearer $METABOT_API_SECRET" \
-H "Content-Type: application/json" \
-d '{"platform":"telegram","name":"<name>","telegramBotToken":"...","defaultWorkingDirectory":"/path","installSkills":true}'
Remove bot:
curl -s -X DELETE http://localhost:${METABOT_API_PORT:-9100}/api/bots/<name> \
-H "Authorization: Bearer $METABOT_API_SECRET"
Update scheduled task:
curl -s -X PATCH http://localhost:${METABOT_API_PORT:-9100}/api/schedule/<id> \
-H "Authorization: Bearer $METABOT_API_SECRET" \
-H "Content-Type: application/json" \
-d '{"prompt":"updated prompt","delaySeconds":7200}'
Create recurring scheduled task (cron):
curl -s -X POST http://localhost:${METABOT_API_PORT:-9100}/api/schedule \
-H "Authorization: Bearer $METABOT_API_SECRET" \
-H "Content-Type: application/json" \
-d '{"botName":"<bot>","chatId":"<chatId>","prompt":"<task>","cronExpr":"0 8 * * 1-5","timezone":"Asia/Shanghai","label":"Daily report"}'
Cron format: minute hour day month weekday (5 fields). Examples: 0 8 * * * = daily 8am, 0 8 * * 1-5 = weekdays 8am, */30 * * * * = every 30 min. Default timezone: Asia/Shanghai.
Pause/resume recurring task:
curl -s -X POST http://localhost:${METABOT_API_PORT:-9100}/api/schedule/<id>/pause \
-H "Authorization: Bearer $METABOT_API_SECRET"
curl -s -X POST http://localhost:${METABOT_API_PORT:-9100}/api/schedule/<id>/resume \
-H "Authorization: Bearer $METABOT_API_SECRET"
Update recurring task:
curl -s -X PATCH http://localhost:${METABOT_API_PORT:-9100}/api/schedule/<id> \
-H "Authorization: Bearer $METABOT_API_SECRET" \
-H "Content-Type: application/json" \
-d '{"cronExpr":"0 9 * * *","prompt":"Updated prompt","timezone":"Asia/Shanghai"}'
List peers:
curl -s http://localhost:${METABOT_API_PORT:-9100}/api/peers \
-H "Authorization: Bearer $METABOT_API_SECRET"
When asked to create a bot:
- Ask user for platform + credentials + project name + working directory
- POST /api/bots with installSkills:true
- Report success — new bot activates within ~3 seconds via PM2 file-watch