← All MCP tools

MCP tool

import_outcomes

Import up to 500 authenticated analytics, commerce, CRM or offline response events for one campaign. Each event needs an opaque source event id for deterministic deduplication. Raw identifiers are forbidden; optional household identity must already be a SHA-256 hash. A promo code is accepted only when provisioned for this campaign. Imported response remains correlational unless deterministic evidence or a powered causal test supports it.

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": {
    "campaignId": {
      "type": "string",
      "minLength": 1,
      "description": "target campaign id"
    },
    "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"
    },
    "source": {
      "type": "object",
      "properties": {
        "key": {
          "type": "string",
          "minLength": 2,
          "maxLength": 64,
          "pattern": "^[a-z0-9][a-z0-9_-]*$",
          "description": "stable lowercase feed key, e.g. shopify"
        },
        "kind": {
          "type": "string",
          "enum": [
            "analytics",
            "commerce",
            "crm",
            "offline",
            "other"
          ]
        },
        "reference": {
          "description": "opaque dataset or export reference; never raw identity",
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9._:/-]+$"
        }
      },
      "required": [
        "key",
        "kind"
      ]
    },
    "privacy": {
      "type": "object",
      "properties": {
        "lawfulBasis": {
          "type": "string",
          "enum": [
            "consent",
            "legitimate-interest"
          ]
        },
        "consentConfirmed": {
          "type": "boolean",
          "description": "must be true when lawfulBasis is consent"
        },
        "identityMode": {
          "type": "string",
          "enum": [
            "none",
            "household-sha256"
          ]
        },
        "rawIdentifiersRemoved": {
          "type": "boolean",
          "const": true,
          "description": "required privacy attestation"
        }
      },
      "required": [
        "lawfulBasis",
        "consentConfirmed",
        "identityMode",
        "rawIdentifiersRemoved"
      ]
    },
    "events": {
      "minItems": 1,
      "maxItems": 500,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "eventId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9._:-]+$",
            "description": "opaque source id; do not send an email or raw identity"
          },
          "ts": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          },
          "kind": {
            "type": "string",
            "enum": [
              "pageview",
              "conversion"
            ]
          },
          "valueMinor": {
            "type": "integer",
            "minimum": 0,
            "maximum": 2147483647
          },
          "promoCode": {
            "type": "string",
            "maxLength": 64,
            "pattern": "^CHORUS-[A-Z]{2,3}-[0-9A-F]{4}$"
          },
          "market": {
            "description": "aggregate market key",
            "type": "string",
            "minLength": 2,
            "maxLength": 64,
            "pattern": "^[a-z0-9][a-z0-9_-]*$"
          },
          "householdKeyHash": {
            "description": "SHA-256 only; never a raw household identifier",
            "type": "string",
            "pattern": "^[0-9a-f]{64}$"
          }
        },
        "required": [
          "eventId",
          "ts",
          "kind"
        ]
      }
    }
  },
  "required": [
    "campaignId",
    "agentStepId",
    "expectedActionDigest",
    "source",
    "privacy",
    "events"
  ]
}

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": "POST",
  "path": "/api/v1/campaigns/{campaignId}/outcomes/import",
  "pathFields": [
    "campaignId"
  ],
  "pathSchema": {
    "type": "object",
    "properties": {
      "campaignId": {
        "type": "string",
        "minLength": 1,
        "description": "target campaign id"
      }
    },
    "additionalProperties": false,
    "required": [
      "campaignId"
    ]
  },
  "pathEncoding": "encodeURIComponent for each path field",
  "governedAction": "outcome.import",
  "headers": {
    "x-chorus-agent-step-id": "agentStepId",
    "x-chorus-agent-action-digest": "expectedActionDigest"
  },
  "bodySchema": {
    "type": "object",
    "properties": {
      "source": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "minLength": 2,
            "maxLength": 64,
            "pattern": "^[a-z0-9][a-z0-9_-]*$",
            "description": "stable lowercase feed key, e.g. shopify"
          },
          "kind": {
            "type": "string",
            "enum": [
              "analytics",
              "commerce",
              "crm",
              "offline",
              "other"
            ]
          },
          "reference": {
            "description": "opaque dataset or export reference; never raw identity",
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9._:/-]+$"
          }
        },
        "required": [
          "key",
          "kind"
        ]
      },
      "privacy": {
        "type": "object",
        "properties": {
          "lawfulBasis": {
            "type": "string",
            "enum": [
              "consent",
              "legitimate-interest"
            ]
          },
          "consentConfirmed": {
            "type": "boolean",
            "description": "must be true when lawfulBasis is consent"
          },
          "identityMode": {
            "type": "string",
            "enum": [
              "none",
              "household-sha256"
            ]
          },
          "rawIdentifiersRemoved": {
            "type": "boolean",
            "const": true,
            "description": "required privacy attestation"
          }
        },
        "required": [
          "lawfulBasis",
          "consentConfirmed",
          "identityMode",
          "rawIdentifiersRemoved"
        ]
      },
      "events": {
        "minItems": 1,
        "maxItems": 500,
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "eventId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$",
              "description": "opaque source id; do not send an email or raw identity"
            },
            "ts": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
            },
            "kind": {
              "type": "string",
              "enum": [
                "pageview",
                "conversion"
              ]
            },
            "valueMinor": {
              "type": "integer",
              "minimum": 0,
              "maximum": 2147483647
            },
            "promoCode": {
              "type": "string",
              "maxLength": 64,
              "pattern": "^CHORUS-[A-Z]{2,3}-[0-9A-F]{4}$"
            },
            "market": {
              "description": "aggregate market key",
              "type": "string",
              "minLength": 2,
              "maxLength": 64,
              "pattern": "^[a-z0-9][a-z0-9_-]*$"
            },
            "householdKeyHash": {
              "description": "SHA-256 only; never a raw household identifier",
              "type": "string",
              "pattern": "^[0-9a-f]{64}$"
            }
          },
          "required": [
            "eventId",
            "ts",
            "kind"
          ]
        }
      }
    },
    "additionalProperties": false,
    "required": [
      "source",
      "privacy",
      "events"
    ]
  },
  "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": {
    "import": {
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {}
    }
  },
  "required": [
    "import"
  ],
  "additionalProperties": {}
}

Safety annotations

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

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

import_outcomes | AdBuyMCP docs