← All MCP tools

MCP tool

set_plan_search_keywords

Apply one buyer-reviewed keyword and negative-keyword set to every Google/Microsoft search line in a draft brand plan. Requires the latest selectionVersion so a stale agent cannot overwrite a buyer’s newer selection, plus the exact buyerPreviewVersion after reviewing provider match types, networks, bidding, budgets and account revisions. This edits targeting but does not approve or launch spend, and still requires a human-approved agent action bound to the exact plan snapshot.

Input

Pass fields from this schema as the tool arguments. Runtime ownership, product scope and readiness checks still apply.

Input JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "planId": {
      "type": "string",
      "minLength": 1
    },
    "agentStepId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 128,
      "description": "pending execute-step id that consumed the exact approved action"
    },
    "expectedActionDigest": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$",
      "description": "SHA-256 digest returned for the exact approved action"
    },
    "expectedSelectionVersion": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$"
    },
    "acknowledgedBuyerPreviewVersion": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$"
    },
    "keywords": {
      "minItems": 1,
      "maxItems": 20,
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 80
      }
    },
    "negativeKeywords": {
      "maxItems": 50,
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 80
      }
    }
  },
  "required": [
    "planId",
    "agentStepId",
    "expectedActionDigest",
    "expectedSelectionVersion",
    "acknowledgedBuyerPreviewVersion",
    "keywords"
  ]
}

REST mapping and authority

The tool wraps this REST endpoint. The mapping identifies path/query/body transformations and approval or idempotency headers.

Request contract
{
  "method": "PATCH",
  "path": "/api/v1/plans/{planId}/search-keywords",
  "pathFields": [
    "planId"
  ],
  "pathSchema": {
    "type": "object",
    "properties": {
      "planId": {
        "type": "string",
        "minLength": 1
      }
    },
    "additionalProperties": false,
    "required": [
      "planId"
    ]
  },
  "pathEncoding": "encodeURIComponent for each path field",
  "governedAction": "plan.search-keywords.update",
  "headers": {
    "x-chorus-agent-step-id": "agentStepId",
    "x-chorus-agent-action-digest": "expectedActionDigest"
  },
  "bodySchema": {
    "type": "object",
    "properties": {
      "expectedSelectionVersion": {
        "type": "string",
        "pattern": "^[a-f0-9]{64}$"
      },
      "acknowledgedBuyerPreviewVersion": {
        "type": "string",
        "pattern": "^[a-f0-9]{64}$"
      },
      "keywords": {
        "minItems": 1,
        "maxItems": 20,
        "type": "array",
        "items": {
          "type": "string",
          "minLength": 1,
          "maxLength": 80
        }
      },
      "negativeKeywords": {
        "maxItems": 50,
        "type": "array",
        "items": {
          "type": "string",
          "minLength": 1,
          "maxLength": 80
        }
      }
    },
    "additionalProperties": false,
    "required": [
      "expectedSelectionVersion",
      "acknowledgedBuyerPreviewVersion",
      "keywords"
    ]
  },
  "responseMapping": "REST JSON is returned as MCP structuredContent and a compatibility text block; privacy-sensitive tools validate their output schema."
}

Output

This is the registered MCP output envelope. Nested fields are only modeled where the schema explicitly defines them.

Output JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {},
  "additionalProperties": {}
}

Safety annotations

MCP annotations
{
  "readOnlyHint": false,
  "destructiveHint": true,
  "idempotentHint": false,
  "openWorldHint": false
}

Annotations help a client present the tool. The API independently enforces authorization and exact action approvals. Error and retry guidance →

set_plan_search_keywords | AdBuyMCP docs