get_campaign
Fetch detailed information about a specific newsletter campaign by providing its ID, including subject, content, sender details, target segment, and delivery status.
Instructions
Fetch a single campaign by ID.
Args: campaign_id: The campaign ID (e.g. "mc_12345").
Returns: Campaign details including subject, body, sender, segment, and delivery status.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| campaign_id | Yes |
Implementation Reference
- mcp_server.py:111-122 (handler)The MCP tool definition for `get_campaign` which serves as the entry point and registers the tool.
@mcp.tool() def get_campaign(campaign_id: str) -> dict: """ Fetch a single campaign by ID. Args: campaign_id: The campaign ID (e.g. "mc_12345"). Returns: Campaign details including subject, body, sender, segment, and delivery status. """ return _client.get_campaign(campaign_id) - client.py:110-114 (handler)The actual implementation of `get_campaign` in the `KeilaClient` class, which makes the HTTP request to the Keila API.
def get_campaign(self, campaign_id: str) -> dict: """Fetch a single campaign by ID.""" resp = self.session.get(f"{self.url}/api/v1/campaigns/{campaign_id}", headers=self._headers(), timeout=30) resp.raise_for_status() return resp.json()