Skip to main content
Glama
JanNafta

PropellerAds MCP Server

by JanNafta

compare_periods

Analyze and compare advertising campaign performance between two time periods to identify trends and optimize strategies.

Instructions

Compare performance between two time periods.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
period1_fromYesPeriod 1 start date (YYYY-MM-DD)
period1_toYesPeriod 1 end date (YYYY-MM-DD)
period2_fromYesPeriod 2 start date (YYYY-MM-DD)
period2_toYesPeriod 2 end date (YYYY-MM-DD)
campaign_idNoOptional: Filter by campaign ID

Implementation Reference

  • The handler logic for 'compare_periods' which fetches statistics for two periods and generates a Markdown comparison table.
    elif name == "compare_periods":
        stats1 = client.get_statistics(
            date_from=args["period1_from"],
            date_to=args["period1_to"],
            campaign_id=args.get("campaign_id"),
        )
        stats2 = client.get_statistics(
            date_from=args["period2_from"],
            date_to=args["period2_to"],
            campaign_id=args.get("campaign_id"),
        )
    
        m1 = calculate_metrics(stats1[0] if stats1 else {})
        m2 = calculate_metrics(stats2[0] if stats2 else {})
    
        def change(v1: float, v2: float) -> str:
            if v1 == 0:
                return "N/A"
            pct = ((v2 - v1) / v1) * 100
            arrow = "📈" if pct > 0 else "📉" if pct < 0 else "➡️"
            return f"{arrow} {pct:+.1f}%"
    
        return (
            f"# Period Comparison\n\n"
            f"**Period 1:** {args['period1_from']} to {args['period1_to']}\n"
            f"**Period 2:** {args['period2_from']} to {args['period2_to']}\n\n"
            f"| Metric | Period 1 | Period 2 | Change |\n"
            f"|--------|----------|----------|--------|\n"
            f"| Impressions | {m1.get('impressions', 0):,} | {m2.get('impressions', 0):,} | {change(m1.get('impressions', 0), m2.get('impressions', 0))} |\n"
            f"| Clicks | {m1.get('clicks', 0):,} | {m2.get('clicks', 0):,} | {change(m1.get('clicks', 0), m2.get('clicks', 0))} |\n"
            f"| CTR | {format_percentage(m1.get('ctr'))} | {format_percentage(m2.get('ctr'))} | {change(m1.get('ctr', 0), m2.get('ctr', 0))} |\n"
            f"| Conversions | {m1.get('conversions', 0):,} | {m2.get('conversions', 0):,} | {change(m1.get('conversions', 0), m2.get('conversions', 0))} |\n"
            f"| Spend | {format_currency(m1.get('spend', 0))} | {format_currency(m2.get('spend', 0))} | {change(m1.get('spend', 0), m2.get('spend', 0))} |\n"
            f"| ROI | {format_percentage(m1.get('roi'))} | {format_percentage(m2.get('roi'))} | {change(m1.get('roi', 0), m2.get('roi', 0))} |\n"
        )
    
    elif name == "get_zone_performance":
        zones = client.get_zone_statistics(
            campaign_id=args.get("campaign_id"),
            date_from=args.get("date_from"),
  • Registration of the 'compare_periods' tool with its schema definition in the server tool list.
    Tool(
        name="compare_periods",
        description="Compare performance between two time periods.",
        inputSchema={
            "type": "object",
            "properties": {
                "period1_from": {
                    "type": "string",
                    "description": "Period 1 start date (YYYY-MM-DD)",
                },
                "period1_to": {
                    "type": "string",
                    "description": "Period 1 end date (YYYY-MM-DD)",
                },
                "period2_from": {
                    "type": "string",
                    "description": "Period 2 start date (YYYY-MM-DD)",
                },
                "period2_to": {
                    "type": "string",
                    "description": "Period 2 end date (YYYY-MM-DD)",
                },
                "campaign_id": {
                    "type": "integer",
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool compares performance but doesn't explain what 'performance' entails (e.g., metrics like clicks, conversions), whether it's a read-only operation, if it requires specific permissions, or how results are returned (e.g., as a report or summary). This leaves significant gaps for a tool with no annotation coverage.

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

Conciseness5/5

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

The description is a single, efficient sentence: 'Compare performance between two time periods.' It's front-loaded with the core purpose and has zero wasted words, making it highly concise and well-structured.

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

Completeness2/5

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

Given the complexity of comparing performance across periods, no annotations, and no output schema, the description is incomplete. It doesn't clarify what 'performance' means, the format of results, or behavioral aspects like data access or limitations, making it inadequate for informed tool selection and invocation.

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

Parameters3/5

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

The input schema has 100% description coverage, clearly documenting all parameters (e.g., date formats, optional campaign filtering). The description adds no additional parameter semantics beyond implying time periods are involved, so it meets the baseline score of 3 where the schema does the heavy lifting.

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

Purpose4/5

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

The description clearly states the tool's purpose: 'Compare performance between two time periods.' It specifies the verb ('compare') and resource ('performance'), making it understandable. However, it doesn't distinguish this from sibling tools like 'get_campaign_performance' or 'get_performance_report', which might offer similar functionality, so it misses full differentiation.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, exclusions, or compare it to siblings such as 'get_campaign_performance' or 'get_performance_report', leaving the agent to guess based on context alone.

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/JanNafta/propellerads-mcp'

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