Skip to main content
Glama
Kaiohz

Prospectio MCP API

get_leads.py1.95 kB
from typing import Optional, Union from domain.entities.company import CompanyEntity from domain.entities.contact import ContactEntity from domain.entities.job import JobEntity from domain.entities.leads import Leads from domain.ports.leads_repository import LeadsRepositoryPort class GetLeadsUseCase: """ Use case for retrieving different types of data (companies, jobs, contacts, leads) from the repository. This class acts as a dispatcher to fetch specific data types based on the requested type. """ def __init__(self, type: str, repository: LeadsRepositoryPort): """ Initialize the InsertCompanyJobsUseCase with the data type and repository. Args: type (str): The data type to retrieve ('companies', 'jobs', 'contacts', or 'leads'). repository (LeadsRepositoryPort): The repository interface for data access. """ self.type = type self.repository = repository async def get_leads( self, offset: int, limit: int ) -> Union[Leads, CompanyEntity, JobEntity, ContactEntity]: """ Retrieve data based on the specified type from the repository. Returns: Union[Leads, CompanyEntity, JobEntity, ContactEntity]: The retrieved data object corresponding to the requested type. Raises: KeyError: If the specified type is not supported ('companies', 'jobs', 'contacts', 'leads'). """ if self.type == "companies": return await self.repository.get_companies(offset, limit) elif self.type == "jobs": return await self.repository.get_jobs(offset, limit) elif self.type == "contacts": return await self.repository.get_contacts(offset, limit) elif self.type == "leads": return await self.repository.get_leads(offset, limit) else: raise KeyError(f"Unsupported type: {self.type}")

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Kaiohz/prospectio-api-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server