Skip to main content
Glama

update_campaign

Modify unsent email campaign details like subject, content, sender, or target segment to adjust messaging before distribution.

Instructions

Update an existing campaign (only unsent campaigns can be updated).

Args: campaign_id: The campaign ID (e.g. "mc_12345"). subject: New subject line (optional). text_body: New body content (optional). sender_id: New sender ID (optional). segment_id: New segment ID (optional). preview_text: New preview text (optional).

Returns: The updated campaign record.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
campaign_idYes
subjectNo
text_bodyNo
sender_idNo
segment_idNo
preview_textNo

Implementation Reference

  • The MCP tool handler for update_campaign. It wraps the client method.
    @mcp.tool()
    def update_campaign(campaign_id: str, subject: str | None = None, text_body: str | None = None,
                        sender_id: str | None = None, segment_id: str | None = None,
                        preview_text: str | None = None) -> dict:
        """
        Update an existing campaign (only unsent campaigns can be updated).
    
        Args:
            campaign_id: The campaign ID (e.g. "mc_12345").
            subject: New subject line (optional).
            text_body: New body content (optional).
            sender_id: New sender ID (optional).
            segment_id: New segment ID (optional).
            preview_text: New preview text (optional).
    
        Returns:
            The updated campaign record.
        """
        return _client.update_campaign(campaign_id, subject=subject, text_body=text_body,
                                       sender_id=sender_id, segment_id=segment_id, preview_text=preview_text)
  • The underlying KeilaClient method that performs the API call to update the campaign.
    def update_campaign(self, campaign_id: str, subject: str | None = None, text_body: str | None = None,
                        sender_id: str | None = None, segment_id: str | None = None,
                        preview_text: str | None = None) -> dict:
        """Update an existing campaign."""
        campaign_data = {}
        if subject:
            campaign_data["subject"] = subject
        if text_body:
            campaign_data["text_body"] = text_body
        if sender_id:
            campaign_data["sender_id"] = sender_id
        if segment_id:
            campaign_data["segment_id"] = segment_id
        if preview_text is not None:
            campaign_data["preview_text"] = preview_text
        resp = self.session.patch(f"{self.url}/api/v1/campaigns/{campaign_id}", json={"data": campaign_data},
                                 headers=self._headers(), timeout=30)
        resp.raise_for_status()
        return resp.json()
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden. It discloses the key business constraint (unsent-only updates) and mentions the return value ('The updated campaign record'), but fails to specify error behavior (what happens if campaign_id is invalid or already sent), idempotency properties, or whether null values clear fields versus leaving them unchanged.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Well-structured with clear Args/Returns sections. The constraint is front-loaded in the first sentence. No redundant words, though the Returns section is minimal given no output schema exists to supplement it.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Adequate for a partial-update mutation tool with 6 parameters. Given zero annotation coverage and no output schema, the description covers the essential parameters and basic return type, but lacks detail on error responses, detailed return structure, and complex validation rules that would be expected for a marketing campaign management tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, requiring the description to compensate. The Args section successfully documents all 6 parameters with concise semantic meaning (e.g., 'New subject line', 'New body content') and notes optionality, effectively filling the gap left by the undescribed schema. Deducted one point for minimal detail on validation rules or constraints beyond the example ID format.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Specific verb 'Update' with clear resource 'campaign'. The parenthetical constraint '(only unsent campaigns can be updated)' effectively distinguishes this from sibling tools like create_campaign, send_campaign, or schedule_campaign by defining the specific state (unsent) where this applies.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly states the critical limitation '(only unsent campaigns can be updated)', which defines when NOT to use the tool. However, it lacks explicit guidance on what to do instead if a sent campaign needs modification (e.g., 'create a new campaign instead') or when to prefer this over recreating.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/gwbischof/keila-mcp'

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