@iriseller/mcp-server
Version:
Model Context Protocol (MCP) server providing access to IRISeller's AI sales intelligence platform with 7 AI agents, multi-CRM integration, advanced sales workflows, email automation (detection/sending/campaigns), and robust asynchronous agent execution h
531 lines (530 loc) • 19 kB
JavaScript
// Email Auto-Response Tool for Zoho Integration
export const EMAIL_AUTO_RESPOND_TOOL = {
name: 'email_auto_respond',
description: 'Automatically analyze incoming emails and generate intelligent responses using IRIS agents with sales information',
inputSchema: {
type: 'object',
properties: {
email: {
type: 'object',
properties: {
from: {
type: 'string',
description: 'Sender email address'
},
fromName: {
type: 'string',
description: 'Sender name'
},
subject: {
type: 'string',
description: 'Email subject line'
},
content: {
type: 'string',
description: 'Email body content'
},
messageId: {
type: 'string',
description: 'Database message ID for tracking'
}
},
required: ['from', 'subject', 'content']
},
options: {
type: 'object',
properties: {
urgency: {
type: 'string',
enum: ['low', 'medium', 'high', 'urgent'],
description: 'Email urgency level'
},
responseType: {
type: 'string',
enum: ['informational', 'sales', 'support', 'meeting'],
description: 'Type of response needed'
},
includeAgents: {
type: 'array',
items: {
type: 'string'
},
description: 'Specific agents to include in response generation'
}
}
}
},
required: ['email']
}
};
// Email Intent Analysis Tool
export const EMAIL_INTENT_ANALYSIS_TOOL = {
name: 'analyze_email_intent',
description: 'Analyze incoming email intent and classify the type of inquiry for appropriate agent routing',
inputSchema: {
type: 'object',
properties: {
emailContent: {
type: 'string',
description: 'Email content to analyze'
},
subject: {
type: 'string',
description: 'Email subject line'
},
senderInfo: {
type: 'object',
properties: {
email: { type: 'string' },
name: { type: 'string' },
company: { type: 'string' }
}
}
},
required: ['emailContent']
}
};
// Sales Information Compilation Tool
export const COMPILE_SALES_INFO_TOOL = {
name: 'compile_sales_info',
description: 'Compile comprehensive sales information using multiple IRIS agents for email responses',
inputSchema: {
type: 'object',
properties: {
prospect: {
type: 'object',
properties: {
email: { type: 'string' },
name: { type: 'string' },
company: { type: 'string' },
industry: { type: 'string' }
},
required: ['email']
},
inquiry: {
type: 'object',
properties: {
type: {
type: 'string',
enum: ['product_info', 'pricing', 'demo_request', 'support', 'partnership', 'general']
},
details: { type: 'string' },
urgency: { type: 'string' }
}
},
agentWorkflows: {
type: 'array',
items: {
type: 'string',
enum: ['prospecting', 'qualification', 'research', 'personalization', 'objection_handling']
},
description: 'Specific workflows to execute'
}
},
required: ['prospect', 'inquiry']
}
};
// Email Response Generator Tool
export const GENERATE_EMAIL_RESPONSE_TOOL = {
name: 'generate_email_response',
description: 'Generate personalized email responses based on sales information and agent insights',
inputSchema: {
type: 'object',
properties: {
originalEmail: {
type: 'object',
properties: {
from: { type: 'string' },
subject: { type: 'string' },
content: { type: 'string' }
}
},
salesInfo: {
type: 'object',
description: 'Compiled sales information from agents'
},
responseStyle: {
type: 'string',
enum: ['professional', 'friendly', 'consultant', 'technical'],
default: 'professional'
},
includeAttachments: {
type: 'boolean',
description: 'Whether to include relevant sales materials',
default: false
}
},
required: ['originalEmail', 'salesInfo']
}
};
// Email Follow-up Scheduler Tool
export const SCHEDULE_EMAIL_FOLLOWUP_TOOL = {
name: 'schedule_email_followup',
description: 'Schedule automated follow-up emails based on prospect engagement and sales stage',
inputSchema: {
type: 'object',
properties: {
prospect: {
type: 'object',
properties: {
email: { type: 'string' },
name: { type: 'string' },
company: { type: 'string' }
},
required: ['email']
},
followupType: {
type: 'string',
enum: ['gentle_reminder', 'value_add', 'case_study', 'demo_invite', 'pricing_info']
},
delay: {
type: 'object',
properties: {
value: { type: 'number' },
unit: {
type: 'string',
enum: ['minutes', 'hours', 'days', 'weeks']
}
},
required: ['value', 'unit']
},
conditions: {
type: 'object',
properties: {
ifNoResponse: { type: 'boolean' },
ifNotOpened: { type: 'boolean' },
ifNotClicked: { type: 'boolean' }
}
}
},
required: ['prospect', 'followupType', 'delay']
}
};
// Email Analytics Tool
export const EMAIL_ANALYTICS_TOOL = {
name: 'get_email_analytics',
description: 'Get analytics and insights on email campaigns and responses',
inputSchema: {
type: 'object',
properties: {
timeRange: {
type: 'object',
properties: {
start: { type: 'string', format: 'date-time' },
end: { type: 'string', format: 'date-time' }
}
},
metrics: {
type: 'array',
items: {
type: 'string',
enum: ['open_rate', 'response_rate', 'conversion_rate', 'agent_performance', 'revenue_attribution']
}
},
filters: {
type: 'object',
properties: {
prospect: { type: 'string' },
agent: { type: 'string' },
campaign: { type: 'string' }
}
}
}
}
};
// Email Detection Tool - Monitor for new emails
export const EMAIL_DETECTION_TOOL = {
name: 'detect_emails',
description: 'Monitor and detect new incoming emails from configured email accounts with filtering and processing options',
inputSchema: {
type: 'object',
properties: {
accountType: {
type: 'string',
enum: ['zoho', 'outlook', 'gmail', 'imap'],
description: 'Type of email account to monitor'
},
filters: {
type: 'object',
properties: {
unreadOnly: {
type: 'boolean',
default: true,
description: 'Only detect unread emails'
},
fromDomain: {
type: 'string',
description: 'Filter emails from specific domain'
},
keywords: {
type: 'array',
items: { type: 'string' },
description: 'Keywords to filter emails by (subject or content)'
},
excludeAutomated: {
type: 'boolean',
default: true,
description: 'Exclude automated/bounce emails'
},
sinceTimestamp: {
type: 'string',
format: 'date-time',
description: 'Only detect emails since this timestamp'
}
}
},
limit: {
type: 'number',
minimum: 1,
maximum: 100,
default: 10,
description: 'Maximum number of emails to return'
},
includeContent: {
type: 'boolean',
default: true,
description: 'Include full email content in response'
},
markAsRead: {
type: 'boolean',
default: false,
description: 'Mark detected emails as read'
}
}
}
};
// Email Sending Tool - Send emails via automation system
export const EMAIL_SENDING_TOOL = {
name: 'send_email',
description: 'Send emails using the IRISeller email automation system with template support and tracking',
inputSchema: {
type: 'object',
properties: {
to: {
oneOf: [
{ type: 'string', format: 'email' },
{ type: 'array', items: { type: 'string', format: 'email' } }
],
description: 'Recipient email address(es)'
},
subject: {
type: 'string',
description: 'Email subject line'
},
content: {
type: 'object',
properties: {
text: {
type: 'string',
description: 'Plain text email content'
},
html: {
type: 'string',
description: 'HTML email content'
}
},
description: 'Email content (text and/or HTML)'
},
template: {
type: 'object',
properties: {
type: {
type: 'string',
enum: ['professional', 'casual', 'follow_up', 'meeting_invite', 'proposal'],
description: 'Email template type'
},
data: {
type: 'object',
description: 'Template data for personalization'
}
},
description: 'Use predefined template with data'
},
options: {
type: 'object',
properties: {
replyTo: {
type: 'string',
format: 'email',
description: 'Reply-to email address'
},
priority: {
type: 'string',
enum: ['low', 'normal', 'high'],
default: 'normal',
description: 'Email priority'
},
trackOpens: {
type: 'boolean',
default: true,
description: 'Track email opens'
},
trackClicks: {
type: 'boolean',
default: true,
description: 'Track link clicks'
},
scheduleTime: {
type: 'string',
format: 'date-time',
description: 'Schedule email for future sending'
}
}
}
},
required: ['to', 'subject']
}
};
// Email Status Monitoring Tool
export const EMAIL_STATUS_TOOL = {
name: 'get_email_status',
description: 'Monitor email automation system status and get statistics on email processing',
inputSchema: {
type: 'object',
properties: {
includeStats: {
type: 'boolean',
default: true,
description: 'Include processing statistics'
},
includeQueue: {
type: 'boolean',
default: false,
description: 'Include current email queue status'
},
timeRange: {
type: 'object',
properties: {
start: { type: 'string', format: 'date-time' },
end: { type: 'string', format: 'date-time' }
},
description: 'Time range for statistics'
}
}
}
};
// Email Template Management Tool
export const EMAIL_TEMPLATE_TOOL = {
name: 'manage_email_templates',
description: 'Create, update, and manage email templates for automated responses',
inputSchema: {
type: 'object',
properties: {
action: {
type: 'string',
enum: ['list', 'get', 'create', 'update', 'delete'],
description: 'Action to perform on templates'
},
templateId: {
type: 'string',
description: 'Template ID (required for get, update, delete actions)'
},
template: {
type: 'object',
properties: {
name: {
type: 'string',
description: 'Template name'
},
type: {
type: 'string',
enum: ['professional', 'casual', 'follow_up', 'meeting_invite', 'proposal'],
description: 'Template type'
},
subject: {
type: 'string',
description: 'Email subject template with variables'
},
content: {
type: 'object',
properties: {
text: { type: 'string' },
html: { type: 'string' }
},
description: 'Template content with variables'
},
variables: {
type: 'array',
items: { type: 'string' },
description: 'Available template variables'
}
},
description: 'Template data (required for create and update actions)'
}
},
required: ['action']
}
};
// Email Campaign Management Tool
export const EMAIL_CAMPAIGN_TOOL = {
name: 'manage_email_campaigns',
description: 'Create and manage email campaigns with automated sequences and tracking',
inputSchema: {
type: 'object',
properties: {
action: {
type: 'string',
enum: ['create', 'start', 'pause', 'stop', 'get_stats', 'list'],
description: 'Campaign action to perform'
},
campaignId: {
type: 'string',
description: 'Campaign ID (required for start, pause, stop, get_stats actions)'
},
campaign: {
type: 'object',
properties: {
name: {
type: 'string',
description: 'Campaign name'
},
type: {
type: 'string',
enum: ['drip', 'broadcast', 'follow_up', 'nurture'],
description: 'Campaign type'
},
recipients: {
type: 'array',
items: {
type: 'object',
properties: {
email: { type: 'string', format: 'email' },
name: { type: 'string' },
data: { type: 'object' }
}
},
description: 'Campaign recipients with personalization data'
},
sequence: {
type: 'array',
items: {
type: 'object',
properties: {
templateId: { type: 'string' },
delay: { type: 'number', description: 'Delay in hours' },
conditions: { type: 'object' }
}
},
description: 'Email sequence configuration'
}
},
description: 'Campaign configuration (required for create action)'
}
},
required: ['action']
}
};
// Export all email tools
export const EMAIL_TOOLS = [
EMAIL_AUTO_RESPOND_TOOL,
EMAIL_INTENT_ANALYSIS_TOOL,
COMPILE_SALES_INFO_TOOL,
GENERATE_EMAIL_RESPONSE_TOOL,
SCHEDULE_EMAIL_FOLLOWUP_TOOL,
EMAIL_ANALYTICS_TOOL,
EMAIL_DETECTION_TOOL,
EMAIL_SENDING_TOOL,
EMAIL_STATUS_TOOL,
EMAIL_TEMPLATE_TOOL,
EMAIL_CAMPAIGN_TOOL
];