---
name: extend-campaign-end-date
description: Extend the end date of an active ad campaign. Use when an operator asks to extend, push back, or change the end date of a campaign.
---

# Extend Campaign End Date

You are helping an Ads Ops operator extend the end date of a campaign. Follow these steps carefully.

## Step 1: Collect Inputs

You need two pieces of information:

1. **Campaign ID** (required): a numeric ID
2. **New end date** (required): must be in the format `yyyy-MM-dd HH:mm:ss` in UTC

If the operator provided arguments (e.g., `/extend-campaign-end-date 12345 2026-12-31 23:59:59`), parse them directly.

If the operator gave a relative or natural language date, convert it:
- "end of year" or "EOY" means `2026-12-31 23:59:59` (use the current year)
- "end of month" means the last day of the current month at `23:59:59`
- "push back by N days" means you will need the current end date from the tool response. Proceed with the call and compute the new date after seeing the current end date. Ask the operator to confirm the computed date before making a second call if needed.

If either input is missing, ask the operator to provide it. Do not guess campaign IDs.

## Step 2: Validate the Date

Before calling the tool, confirm:
- The date string matches `yyyy-MM-dd HH:mm:ss` format
- The date is in the future
- The year is reasonable (not wildly far out)

If the date looks off, ask the operator to confirm before proceeding.

## Step 3: Call the MCP Tool

Call the `extend_campaign_end_date` tool with:
- `campaign_id`: the campaign ID as a string
- `new_end_date`: the validated date string in `yyyy-MM-dd HH:mm:ss` format

## Step 4: Display Results

After the tool returns, present a clear summary:

### Success Case

```
Campaign Extension Summary
==========================
Campaign ID:      {campaign_id}
Previous End Date: {previous_end_date}
New End Date:      {new_end_date}

Ad Group Results:
| Ad Group ID | Status   | Details                    |
|-------------|----------|----------------------------|
| 11111       | Extended | End date updated           |
| 22222       | Skipped  | Already ends after new date|
| 33333       | Skipped  | Ad group is paused         |
```

### Error Case

If the tool returns an error, display it clearly:

```
Error extending campaign {campaign_id}:
{error_message}

Common causes:
- Campaign ID does not exist
- Campaign is not in an active state
- New end date is before the current end date
- Authentication or permission issue
```

Suggest corrective actions based on the error.

## Step 5: Log Summary

After displaying results, print a one line summary suitable for the operator's log:

```
[{timestamp}] Extended campaign {campaign_id} end date from {old_date} to {new_date}. {N} ad groups extended, {M} skipped.
```

## Common Operator Patterns

**Direct date:**
> "Extend campaign 12345 to 2026-12-31 23:59:59"

Parse and call directly.

**Natural language date:**
> "Extend campaign 12345 to end of year"

Convert "end of year" to `2026-12-31 23:59:59` and confirm with the operator before calling.

**Relative extension:**
> "Push back campaign 12345 by 30 days"

Call the tool to see the current end date in the response, compute the new date (current + 30 days), confirm with the operator, then call again with the computed date.

**Multiple campaigns:**
> "Extend campaigns 12345, 67890, and 11111 to 2026-06-30 23:59:59"

Process each campaign one at a time, displaying results for each.
