Overview
This guide demonstrates how to use AgentSource MCP (Model Context Protocol) with OpenAI’s API. MCP enables your AI agents to seamlessly access Explorium’s data through a standardized protocol, allowing for dynamic tool discovery and execution.Prerequisites
- Python 3.8 or higher
- OpenAI API key
- AgentSource API key
- Basic understanding of OpenAI’s API
Installation
First, install the required package:Bash
Quick Start
1. Initialize the OpenAI Client
Python
2. Configure AgentSource MCP
Create a response with MCP tools configured:Python
3. Basic Example
Here’s a complete example that searches for companies:Python
Common Use Cases
Finding Companies with Specific Criteria
Python
Finding Contacts at Specific Companies
Python
Analyzing Specific Departments
Python
Understanding the Response
The MCP integration automatically handles:- Tool discovery and listing
- Parameter formatting
- API calls to AgentSource
- Response parsing
Advanced Configuration
Multi-turn Conversations
For follow-up queries in the same context:Python
Tool Approval Settings
You can control whether tools require approval before execution:"never"
- Tools execute automatically"always"
- Tools require user approval"on_error"
- Approval required only on errors
Debugging and Monitoring
Response Tracing
To understand the execution flow, you can inspect the response object which contains:- Tool calls made
- Input parameters sent
- Responses received
- Agent’s interpretation
Example Response Structure
Python
Best Practices
-
API Key Security: Never hardcode API keys in your code. Use environment variables:
Python
-
Clear Queries: Be specific in your queries for better results:
- “Find 20 CTOs at fintech companies in New York with 50-200 employees”
- “Find some tech people”
- Handle Rate Limits: Implement appropriate error handling and retries
- Optimize Requests: Batch related queries when possible to reduce API calls
Available Tools
Through MCP, your agent automatically has access to all AgentSource tools including:- Company Search: Find businesses based on various criteria
- Contact Discovery: Locate professionals with specific roles
- Email Enrichment: Get contact information
- Company Matching: Match and enrich company data
- Prospect Matching: Match and enrich prospect data
- And more: The full suite of AgentSource capabilities
Error Handling
Python
Next Steps
- Explore the complete AgentSource MCP documentation
- Check out implementations using other frameworks (LangGraph, Python SDK)
- Learn about advanced filtering and search capabilities
- Understand rate limits and quotas
Support
If you encounter any issues or have questions:- Contact our support team at support@explorium.ai
- Join our developer community
Note: Remember to replaceYOUR_AGENTSOURCE_API_KEY and your-openai-api-key with your actual API keys.