Documentation / MCP / campaigns_organizations

campaigns_organizations

POSThttps://mcp.oppalerts.com/mcptool: campaigns_organizations

Lists the organizations of one campaign, each with its relationship, its hosts, its brand names, and its chart color.

What it does

The tool lists the organizations of one campaign: every organization of the campaign, with its relationship, its hosts, its brand names, and its chart color. The index tools use these relationship values to label result rows. campaign is required.

This tool only reads. The change tools campaigns_organization_add, campaigns_organization_update, and campaigns_organization_delete change the organizations.

Connect

claude mcp add --transport http oppalerts https://mcp.oppalerts.com/mcp

The first call opens a browser window for the OppAlerts login. Connect an AI Agent has the details.

Parameters

campaignint, required, 1 to 4294967295
The campaign id, from campaigns_list. It must be a campaign of your account.

Strict Rules

  • A field that is not in the list above is refused. The result then has isError true, and its text starts with bad_param. The error names the field: "<field> is not a field of this tool." The old name of a renamed field is refused in the same way.
  • A bad value is refused, and the error names the field. A bad value is a value of the wrong type, a number with a fraction for a whole-number field, a value out of its range, or a value that is not in its list. A required field that you do not send is refused too. The tool never changes a value that you send.
  • An error about the format of a call, such as a refused field, names the field. Its message ends with one sentence: "Read the documentation at https://oppalerts.com/docs for the correct format." Every other error has only its own sentence.

Response fields

organizationslist
One item for each organization of the campaign.
organizations[].idint
The organization id.
organizations[].relationshipstring
The relationship to the brand: org_owned_brand, org_competitor, org_partner, or org_publisher.
organizations[].hostslist of strings
The hosts of the organization.
organizations[].brand_nameslist of strings
The brand names of the organization.
organizations[].colorint, optional
The chart color of the organization, as a number. Left out when the organization has no color.
organizations[].color_hexstring, optional
The chart color of the organization, as a hex color, for example #1f77b4. Left out when the organization has no color.

Example

Call

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "campaigns_organizations",
    "arguments": {
      "campaign": 3
    }
  }
}

Response

The response is shown in full.

{
  "organizations": [
    {
      "id": 9,
      "relationship": "org_owned_brand",
      "hosts": [
        "example-hotels.com",
        "example-hotels.co.uk"
      ],
      "brand_names": [
        "Example Hotels",
        "Example Hotel Group"
      ],
      "color": 3,
      "color_hex": "#1f77b4"
    }
  ]
}

Errors

An error returns as a tool result with isError true. Its text starts with the error code, except for daily_limit, whose text is only the sentence. The HTTP status shown for each code is its API status.

  • bad_param (HTTP 400 in the API): a field is not a field of this tool, a required field is not sent, or a value has the wrong type or is out of its range. The error names the field.
  • no_campaign (HTTP 404 in the API): the campaign is not in this account
  • db_error (HTTP 500 in the API): the data could not be read
  • daily_limit (HTTP 429 in the API): the account has used all its calls for this tool today. account_calls_left shows when the count resets.

This tool has its own daily count. A call through the API or MCP uses one call from this count. A web app page reading the same data does not count. It is not an index search, so it does not use the shared count of the news_ and prospects_ tools, and the error one_at_a_time does not apply to it.

Same data in the API

POST /v1/campaigns/organizations HTTP/1.1
Host: api.oppalerts.com
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json

{"campaign": 3}