|
|
""" |
|
|
MCP Tool Definitions for AI Agent Tool Calling |
|
|
|
|
|
This module defines all MCP servers as tools that an LLM can call autonomously. |
|
|
Following the Model Context Protocol (MCP) specification. |
|
|
""" |
|
|
|
|
|
from typing import List, Dict, Any |
|
|
|
|
|
|
|
|
|
|
|
MCP_TOOLS: List[Dict[str, Any]] = [ |
|
|
|
|
|
{ |
|
|
"name": "search_web", |
|
|
"description": "Search the web for information about companies, news, technologies, or any topic. Use this to gather real-time information about prospects, competitors, or industry trends.", |
|
|
"input_schema": { |
|
|
"type": "object", |
|
|
"properties": { |
|
|
"query": { |
|
|
"type": "string", |
|
|
"description": "The search query. Be specific and include company names, topics, or keywords." |
|
|
}, |
|
|
"max_results": { |
|
|
"type": "integer", |
|
|
"description": "Maximum number of results to return (default: 5)", |
|
|
"default": 5 |
|
|
} |
|
|
}, |
|
|
"required": ["query"] |
|
|
} |
|
|
}, |
|
|
{ |
|
|
"name": "search_news", |
|
|
"description": "Search for recent news articles about companies, industries, or topics. Use this to find timely information, company announcements, or industry developments.", |
|
|
"input_schema": { |
|
|
"type": "object", |
|
|
"properties": { |
|
|
"query": { |
|
|
"type": "string", |
|
|
"description": "The news search query" |
|
|
}, |
|
|
"max_results": { |
|
|
"type": "integer", |
|
|
"description": "Maximum number of news results (default: 5)", |
|
|
"default": 5 |
|
|
} |
|
|
}, |
|
|
"required": ["query"] |
|
|
} |
|
|
}, |
|
|
|
|
|
|
|
|
{ |
|
|
"name": "save_prospect", |
|
|
"description": "Save or update a prospect (potential customer) in the database. Use this to store information about companies you're targeting for outreach.", |
|
|
"input_schema": { |
|
|
"type": "object", |
|
|
"properties": { |
|
|
"prospect_id": { |
|
|
"type": "string", |
|
|
"description": "Unique identifier for the prospect" |
|
|
}, |
|
|
"company_id": { |
|
|
"type": "string", |
|
|
"description": "Associated company ID" |
|
|
}, |
|
|
"company_name": { |
|
|
"type": "string", |
|
|
"description": "Company name" |
|
|
}, |
|
|
"company_domain": { |
|
|
"type": "string", |
|
|
"description": "Company website domain (e.g., 'shopify.com')" |
|
|
}, |
|
|
"fit_score": { |
|
|
"type": "number", |
|
|
"description": "Fit score (0-100) indicating how well this prospect matches the ideal customer profile" |
|
|
}, |
|
|
"status": { |
|
|
"type": "string", |
|
|
"description": "Status: 'new', 'contacted', 'engaged', 'qualified', 'converted', 'lost'", |
|
|
"enum": ["new", "contacted", "engaged", "qualified", "converted", "lost"] |
|
|
}, |
|
|
"metadata": { |
|
|
"type": "object", |
|
|
"description": "Additional metadata about the prospect" |
|
|
} |
|
|
}, |
|
|
"required": ["prospect_id", "company_id", "company_name", "company_domain"] |
|
|
} |
|
|
}, |
|
|
{ |
|
|
"name": "get_prospect", |
|
|
"description": "Retrieve a prospect's information from the database by ID.", |
|
|
"input_schema": { |
|
|
"type": "object", |
|
|
"properties": { |
|
|
"prospect_id": { |
|
|
"type": "string", |
|
|
"description": "The unique identifier of the prospect to retrieve" |
|
|
} |
|
|
}, |
|
|
"required": ["prospect_id"] |
|
|
} |
|
|
}, |
|
|
{ |
|
|
"name": "list_prospects", |
|
|
"description": "List all prospects in the database. Use this to see what prospects you have and their statuses.", |
|
|
"input_schema": { |
|
|
"type": "object", |
|
|
"properties": { |
|
|
"status": { |
|
|
"type": "string", |
|
|
"description": "Filter by status (optional)", |
|
|
"enum": ["new", "contacted", "engaged", "qualified", "converted", "lost"] |
|
|
} |
|
|
}, |
|
|
"required": [] |
|
|
} |
|
|
}, |
|
|
{ |
|
|
"name": "save_company", |
|
|
"description": "Save or update company information in the database.", |
|
|
"input_schema": { |
|
|
"type": "object", |
|
|
"properties": { |
|
|
"company_id": { |
|
|
"type": "string", |
|
|
"description": "Unique identifier for the company" |
|
|
}, |
|
|
"name": { |
|
|
"type": "string", |
|
|
"description": "Company name" |
|
|
}, |
|
|
"domain": { |
|
|
"type": "string", |
|
|
"description": "Company website domain" |
|
|
}, |
|
|
"industry": { |
|
|
"type": "string", |
|
|
"description": "Industry/sector" |
|
|
}, |
|
|
"description": { |
|
|
"type": "string", |
|
|
"description": "Company description" |
|
|
}, |
|
|
"employee_count": { |
|
|
"type": "integer", |
|
|
"description": "Number of employees" |
|
|
} |
|
|
}, |
|
|
"required": ["company_id", "name", "domain"] |
|
|
} |
|
|
}, |
|
|
{ |
|
|
"name": "get_company", |
|
|
"description": "Retrieve company information from the database by ID.", |
|
|
"input_schema": { |
|
|
"type": "object", |
|
|
"properties": { |
|
|
"company_id": { |
|
|
"type": "string", |
|
|
"description": "The unique identifier of the company" |
|
|
} |
|
|
}, |
|
|
"required": ["company_id"] |
|
|
} |
|
|
}, |
|
|
{ |
|
|
"name": "save_fact", |
|
|
"description": "Save a fact or insight about a company. Use this to store enrichment data like news, funding info, tech stack, pain points, etc.", |
|
|
"input_schema": { |
|
|
"type": "object", |
|
|
"properties": { |
|
|
"fact_id": { |
|
|
"type": "string", |
|
|
"description": "Unique identifier for the fact" |
|
|
}, |
|
|
"company_id": { |
|
|
"type": "string", |
|
|
"description": "Associated company ID" |
|
|
}, |
|
|
"fact_type": { |
|
|
"type": "string", |
|
|
"description": "Type of fact: 'news', 'funding', 'hiring', 'tech_stack', 'pain_point', etc." |
|
|
}, |
|
|
"content": { |
|
|
"type": "string", |
|
|
"description": "The fact content/description" |
|
|
}, |
|
|
"source_url": { |
|
|
"type": "string", |
|
|
"description": "Source URL where this fact was found" |
|
|
}, |
|
|
"confidence_score": { |
|
|
"type": "number", |
|
|
"description": "Confidence score (0-1) for this fact" |
|
|
} |
|
|
}, |
|
|
"required": ["fact_id", "company_id", "fact_type", "content"] |
|
|
} |
|
|
}, |
|
|
{ |
|
|
"name": "discover_prospects_with_contacts", |
|
|
"description": "Find prospect companies WITH verified decision-maker contacts. This tool searches for companies, finds their contacts, and ONLY saves prospects that have real verified contacts. It keeps searching until the target number of valid prospects is found. Use this as your PRIMARY tool for prospect discovery.", |
|
|
"input_schema": { |
|
|
"type": "object", |
|
|
"properties": { |
|
|
"client_company": { |
|
|
"type": "string", |
|
|
"description": "Your client company name (who you're finding prospects for)" |
|
|
}, |
|
|
"client_industry": { |
|
|
"type": "string", |
|
|
"description": "Brief description of what the client does and their target market" |
|
|
}, |
|
|
"target_prospects": { |
|
|
"type": "integer", |
|
|
"description": "Number of prospects WITH contacts to find (default: 3)", |
|
|
"default": 3 |
|
|
}, |
|
|
"target_titles": { |
|
|
"type": "array", |
|
|
"items": {"type": "string"}, |
|
|
"description": "Job titles to search for (default: ['CEO', 'Founder', 'VP Sales', 'CTO'])" |
|
|
} |
|
|
}, |
|
|
"required": ["client_company", "client_industry"] |
|
|
} |
|
|
}, |
|
|
{ |
|
|
"name": "find_verified_contacts", |
|
|
"description": "Find REAL verified decision-makers at a specific company. Searches LinkedIn, company websites, directories, press releases, and social media. Only returns contacts with verified email addresses found on the web.", |
|
|
"input_schema": { |
|
|
"type": "object", |
|
|
"properties": { |
|
|
"company_name": { |
|
|
"type": "string", |
|
|
"description": "The company name to find contacts for" |
|
|
}, |
|
|
"company_domain": { |
|
|
"type": "string", |
|
|
"description": "The company website domain (e.g., 'acme.com')" |
|
|
}, |
|
|
"target_titles": { |
|
|
"type": "array", |
|
|
"items": {"type": "string"}, |
|
|
"description": "List of job titles to search for (e.g., ['CEO', 'VP Sales', 'CTO'])" |
|
|
}, |
|
|
"max_contacts": { |
|
|
"type": "integer", |
|
|
"description": "Maximum number of contacts to find (default: 3)", |
|
|
"default": 3 |
|
|
} |
|
|
}, |
|
|
"required": ["company_name", "company_domain"] |
|
|
} |
|
|
}, |
|
|
{ |
|
|
"name": "save_contact", |
|
|
"description": "Save a contact person that was found by find_verified_contacts. Only use this for contacts returned by find_verified_contacts - NEVER make up contact information.", |
|
|
"input_schema": { |
|
|
"type": "object", |
|
|
"properties": { |
|
|
"contact_id": { |
|
|
"type": "string", |
|
|
"description": "Unique identifier for the contact" |
|
|
}, |
|
|
"company_id": { |
|
|
"type": "string", |
|
|
"description": "Associated company ID" |
|
|
}, |
|
|
"email": { |
|
|
"type": "string", |
|
|
"description": "Contact email address" |
|
|
}, |
|
|
"first_name": { |
|
|
"type": "string", |
|
|
"description": "First name" |
|
|
}, |
|
|
"last_name": { |
|
|
"type": "string", |
|
|
"description": "Last name" |
|
|
}, |
|
|
"title": { |
|
|
"type": "string", |
|
|
"description": "Job title" |
|
|
}, |
|
|
"seniority": { |
|
|
"type": "string", |
|
|
"description": "Seniority level: 'IC', 'Manager', 'Director', 'VP', 'C-Level'" |
|
|
} |
|
|
}, |
|
|
"required": ["contact_id", "company_id", "email"] |
|
|
} |
|
|
}, |
|
|
{ |
|
|
"name": "list_contacts_by_domain", |
|
|
"description": "List all contacts for a specific company domain.", |
|
|
"input_schema": { |
|
|
"type": "object", |
|
|
"properties": { |
|
|
"domain": { |
|
|
"type": "string", |
|
|
"description": "Company domain (e.g., 'shopify.com')" |
|
|
} |
|
|
}, |
|
|
"required": ["domain"] |
|
|
} |
|
|
}, |
|
|
{ |
|
|
"name": "check_suppression", |
|
|
"description": "Check if an email or domain is on the suppression list (opt-outs, bounces, complaints). Use this before sending emails for compliance.", |
|
|
"input_schema": { |
|
|
"type": "object", |
|
|
"properties": { |
|
|
"suppression_type": { |
|
|
"type": "string", |
|
|
"description": "Type: 'email', 'domain'", |
|
|
"enum": ["email", "domain"] |
|
|
}, |
|
|
"value": { |
|
|
"type": "string", |
|
|
"description": "The email address or domain to check" |
|
|
} |
|
|
}, |
|
|
"required": ["suppression_type", "value"] |
|
|
} |
|
|
}, |
|
|
|
|
|
|
|
|
{ |
|
|
"name": "send_email", |
|
|
"description": "Send an email to a prospect. Use this to initiate outreach or follow-up with prospects.", |
|
|
"input_schema": { |
|
|
"type": "object", |
|
|
"properties": { |
|
|
"to": { |
|
|
"type": "string", |
|
|
"description": "Recipient email address" |
|
|
}, |
|
|
"subject": { |
|
|
"type": "string", |
|
|
"description": "Email subject line" |
|
|
}, |
|
|
"body": { |
|
|
"type": "string", |
|
|
"description": "Email body content (can be HTML or plain text)" |
|
|
}, |
|
|
"prospect_id": { |
|
|
"type": "string", |
|
|
"description": "Associated prospect ID for thread tracking" |
|
|
} |
|
|
}, |
|
|
"required": ["to", "subject", "body", "prospect_id"] |
|
|
} |
|
|
}, |
|
|
{ |
|
|
"name": "get_email_thread", |
|
|
"description": "Retrieve the email conversation thread for a prospect.", |
|
|
"input_schema": { |
|
|
"type": "object", |
|
|
"properties": { |
|
|
"prospect_id": { |
|
|
"type": "string", |
|
|
"description": "Prospect ID to get the email thread for" |
|
|
} |
|
|
}, |
|
|
"required": ["prospect_id"] |
|
|
} |
|
|
}, |
|
|
|
|
|
|
|
|
{ |
|
|
"name": "suggest_meeting_slots", |
|
|
"description": "Generate available meeting time slots for scheduling a call with a prospect.", |
|
|
"input_schema": { |
|
|
"type": "object", |
|
|
"properties": { |
|
|
"num_slots": { |
|
|
"type": "integer", |
|
|
"description": "Number of time slots to suggest (default: 3)", |
|
|
"default": 3 |
|
|
} |
|
|
}, |
|
|
"required": [] |
|
|
} |
|
|
}, |
|
|
{ |
|
|
"name": "generate_calendar_invite", |
|
|
"description": "Generate an .ics calendar file for a meeting slot.", |
|
|
"input_schema": { |
|
|
"type": "object", |
|
|
"properties": { |
|
|
"start_time": { |
|
|
"type": "string", |
|
|
"description": "Meeting start time (ISO format)" |
|
|
}, |
|
|
"end_time": { |
|
|
"type": "string", |
|
|
"description": "Meeting end time (ISO format)" |
|
|
}, |
|
|
"title": { |
|
|
"type": "string", |
|
|
"description": "Meeting title" |
|
|
} |
|
|
}, |
|
|
"required": ["start_time", "end_time", "title"] |
|
|
} |
|
|
}, |
|
|
] |
|
|
|
|
|
|
|
|
|
|
|
MCP_RESOURCES = [ |
|
|
{ |
|
|
"uri": "store://prospects", |
|
|
"name": "Prospects Database", |
|
|
"description": "List of all prospects (potential customers) with their status and scores", |
|
|
"mime_type": "application/json" |
|
|
}, |
|
|
{ |
|
|
"uri": "store://companies", |
|
|
"name": "Companies Database", |
|
|
"description": "List of all companies with their information", |
|
|
"mime_type": "application/json" |
|
|
}, |
|
|
{ |
|
|
"uri": "store://contacts", |
|
|
"name": "Contacts Database", |
|
|
"description": "List of all contacts (decision-makers) at companies", |
|
|
"mime_type": "application/json" |
|
|
} |
|
|
] |
|
|
|
|
|
|
|
|
|
|
|
MCP_PROMPTS = [ |
|
|
{ |
|
|
"name": "cold_outreach_email", |
|
|
"description": "Generate a cold outreach email for B2B sales", |
|
|
"arguments": [ |
|
|
{ |
|
|
"name": "company_name", |
|
|
"description": "Name of the target company", |
|
|
"required": True |
|
|
}, |
|
|
{ |
|
|
"name": "pain_points", |
|
|
"description": "Known pain points or challenges of the company", |
|
|
"required": False |
|
|
}, |
|
|
{ |
|
|
"name": "contact_name", |
|
|
"description": "Name of the contact person", |
|
|
"required": False |
|
|
} |
|
|
] |
|
|
}, |
|
|
{ |
|
|
"name": "company_research", |
|
|
"description": "Research a company to identify if they're a good fit for outreach", |
|
|
"arguments": [ |
|
|
{ |
|
|
"name": "company_name", |
|
|
"description": "Name of the company to research", |
|
|
"required": True |
|
|
}, |
|
|
{ |
|
|
"name": "company_domain", |
|
|
"description": "Company website domain", |
|
|
"required": True |
|
|
} |
|
|
] |
|
|
} |
|
|
] |
|
|
|
|
|
|
|
|
def get_tool_by_name(tool_name: str) -> Dict[str, Any]: |
|
|
"""Get a tool definition by name""" |
|
|
for tool in MCP_TOOLS: |
|
|
if tool["name"] == tool_name: |
|
|
return tool |
|
|
return None |
|
|
|
|
|
|
|
|
def list_all_tools() -> List[str]: |
|
|
"""List all available tool names""" |
|
|
return [tool["name"] for tool in MCP_TOOLS] |
|
|
|