line_item_delete
Remove a Line Item from a Campaign Plan. What it created stays live.
Ask the agent to remove one Line Item from a Campaign Plan.
“Remove the LinkedIn Line Item from the spring sale Campaign Plan.”
The agent calls line_item_list to get the id and the revision of the Line Item. Then it calls line_item_delete. You see that the Line Item is gone, and that the Campaign Plan is a draft: a removed Line Item cancels an approval. A campaign that the Line Item created stays live on Meta, and its record stays.
Plan a campaign walks the whole job.
Reference
Delete a Line Item. Pass base_revision from line_item_list or line_item_get: it is the revision of the Line Item, not of the Campaign Plan. Removing a line returns an approved plan to draft, for the same reason adding one does. What the line already created is kept — those objects are live in an ad account and this does not retract them.
Input
| Argument | Type | Required | Description |
|---|---|---|---|
base_revision |
integer | yes | The revision of the Line Item, as you last read it: the revision of that Line Item in line_item_list or line_item_get. It is not the revision of the Campaign Plan. It guards against a write over a change that another person made after your read. |
campaign_plan_name |
string | yes | The Campaign Plan slug — its stable per-organization handle. |
line_item_id |
string | yes | The Line Item id, as returned by line_item_list. |
Output
A successful call returns this object in structuredContent.
| Field | Type | Always present | Description |
|---|---|---|---|
campaignPlanStatus |
one of draft, approved |
yes | The status of the Campaign Plan after the write. It is always draft, because a Line Item that is added or deleted returns an approved Campaign Plan to draft. |
deleted |
true |
yes | |
lineItemId |
string | yes | The id of the deleted Line Item, lni_…. |
Failure codes
A failed call has isError set, and structuredContent.error holds one of these codes. Errors describes the shape of a failed call.
not_foundrevision_mismatchorganization_unentitledforbiddeninvalid_requestinternal_error
Scope
The token must hold campaign_plan:write. Auth & scopes lists each scope.
Annotations
A client reads these hints. A hint that the tool does not declare has the default value of the MCP specification.
- Writes. The tool can change data.
- Destructive. The tool can make a change that you cannot undo. A client can ask you to confirm before it calls the tool.
- Not idempotent. A second call with the same arguments can change more.
- Closed world. The tool reads and writes the data of AdCrunch only.
Example
The arguments:
{
"base_revision": 3,
"campaign_plan_name": "spring-sale",
"line_item_id": "lni_2d9e77"
}
The result, in structuredContent:
{
"campaignPlanStatus": "draft",
"deleted": true,
"lineItemId": "lni_2d9e77"
}