Integration Capabilities
- Activity Sync - Capture events into knowledge graph
- MCP Tools - Expose service actions to AI agents (required)
File Structure
- index.ts - Event router (SETUP, SYNC/PROCESS, GET_TOOLS, CALL_TOOL)
- account-create.ts - OAuth handler
- schedule.ts OR create-activity.ts + identify.ts - Activity sync
- mcp/index.ts - MCP tool definitions and implementations
Integration Types
Webhook-Based - Real-time events (Slack, Discord)- Events: SETUP, IDENTIFY, PROCESS, GET_TOOLS, CALL_TOOL
- Best for: Chat, real-time notifications
- Events: SETUP, SYNC, GET_TOOLS, CALL_TOOL
- Best for: APIs without webhooks, batch processing
- Frequency: 5-15 minute cron schedule
Spec Configuration
Returned bygetSpec() in your CLI class:
Event Types
All integrations handle:Return Types
SETUP - Account creation:MCP Tools
All integrations must implement custom MCP tools usingtype: 'cli':
Best Practices
Activity Messages:- Be descriptive with context
- Always include sourceURL
- Filter noise (only relevant events)
- Save lastSyncTime after each sync
- Default to 24 hours on first sync
- Use pagination for large datasets
- Return empty arrays on errors (don’t throw)
- Continue processing if one item fails
- Validate tokens early
- Use clear descriptions
- Validate all inputs
- Return structured responses
- Handle rate limiting
Reference Examples
- Schedule-based: GitHub, Linear
- Webhook-based: Slack, Discord
- Detailed guides: Schedule-Based Guide, Webhook-Based Guide
