Skip to main content
Glama

create_campaign

Create a new outreach campaign, including the full branching sequence.

Recommended workflow for building a sequence from a natural-language ask:

  1. Call list_sequence_templates first (26 starters; pass key for a full tree), fork the closest one so you don't build from scratch. Fill any [bracketed placeholders] in it: launch is refused while one remains (put a backslash before a bracket to send it as written).

  2. Edit step bodies / delays / branches to match the user's intent.

  3. Call validate_sequence to catch structural issues before activation.

  4. Call preview_sequence (structure) and preview_messages (the rendered messages one prospect would get, with warnings) and show the user both.

  5. Call create_campaign once the user confirms.

Sequence shape: an ordered array of steps (camelCase fields). Each step has an id (unique string, REQUIRED), a type from {connection_request, message, follow_up, inmail, voice_note, view_profile, follow_profile, like_post, find_email, if_open_profile, if_connection}, an optional delayHours (defaults to 0), an optional body (REQUIRED for message/follow_up/inmail; optional invite note for connection_request, supports {{firstName}},{{company}},{{senderName}},…), an optional fallbackBody, withdrawAfterDays (connection_request), and an optional branches object.

Tokens in a body: anything beyond the built-ins must be a REGISTERED custom variable. An unregistered {{token}} is STRIPPED at send time, so the message goes out with a gap in the sentence and nothing reports it, call list_custom_variables first and create_custom_variable for anything missing. If you want literal braces in the copy (a message whose subject IS the templating syntax), escape them: {{example}} renders as {{example}}. Backslashes are counted in pairs, so an odd run escapes and an even one does not: \{{firstName}} is one literal backslash then the substituted name.

Branches fork the sequence. Valid keys on every branching step are accepted and notAccepted (there is no replied/noReply). For message/follow_up/inmail/voice_note, notAccepted is the 'No Reply Yet' follow-up path (a reply stops the sequence, so accepted is usually empty).

voice_note: sends a native LinkedIn voice note. REQUIRES voiceMediaId, upload the clip first with upload_voice_note and pass the returned id. body is an optional caption. A voice note needs a chat to land in, so place it AFTER a connection/message step (or give it a caption so it can open one). Branches on reply like a message.

A/Z testing: any message-bearing step (connection_request / message / follow_up / inmail) can carry variants, an array of { body, fallbackBody? } ALTERNATIVES beyond the primary body (which is Variant A). With 1+ present, sends split evenly across [body, ...variants] and the campaign tracks reply/accept per variant (read with get_campaign_stats with include ab_tests). Omit for no test.

like_post config: reactionType (like | celebrate | support | funny | love | insightful, default like), postsNewerThan (24h | 3d | 1w | 3w | 1mo | 3mo | 6mo | lifetime, only react if the prospect's latest post is newer than this, default 1mo), and skipIfCannotLike (skip ahead when there's no post to like). connection_request takes withdrawAfterDays.

Example: 'connect with a note, then if accepted message after 1 day, else view profile after 1h' → [ { id: 'b', type: 'connection_request', body: 'Hi {{firstName}}, ...', withdrawAfterDays: 14, branches: { accepted: [ { id: 'c', type: 'message', delayHours: 24, body: 'Thanks for connecting!' } ], notAccepted: [ { id: 'd', type: 'view_profile', delayHours: 1 } ] } } ]

Pass status='draft' to keep it editable; 'active' activates immediately (server runs launch validation and returns structured errors, e.g. a message step with empty body, if anything is off).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "name": "<name>",
      "accountIds": "<accountIds>",
      "sequence": "<sequence>"
    },
    "name": "create_campaign"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYesCampaign name.
statusNo'draft' (default) keeps the campaign editable; 'active' activates it immediately after launch validation.draft
languageNoLanguage the sequence is sent in: "" (as written, default), "auto" (each prospect's LinkedIn profile language) or an ISO 639-1 code like "de" or "ar". Not the same as the workspace inbox language (what replies are translated into). With a fixed language, every message step needs a `translations[lang]` entry before launch. With auto, missing languages are translated by the server the first time a prospect needs one. On every save the server keeps only translations the setting can use: a fixed language keeps only its own (switching German to Arabic drops the German ones), "" keeps none, auto keeps all.
scheduleNoCampaign sending window. days are 0..6 (Sun..Sat). Times 'HH:MM'. Omit for an always-on default.
sequenceYesThe branching action tree (camelCase fields). LIMITS: up to 200 steps total (including nested branch steps) and 25 levels of nesting. Run validate_sequence + preview_sequence + preview_messages before activating.
accountIdsYesLinkedIn sender account ids that execute this campaign. Use list_accounts to discover ids.
dailyLimitsNoDaily caps for THIS CAMPAIGN, e.g. { connection_invite: 20, follow_up_message: 30 }. Each number is a total per day across every sender on the campaign, not per account, and not a range the runner varies. Each sending account ALSO has its own daily caps (get_account with include daily_limits); a send needs room under both, so the lower one governs. Omit to leave the campaign uncapped, in which case the account limits alone govern, that is a safe default and usually the right one. Unknown action keys are rejected by the API rather than ignored, so spell them exactly: connection_invite, follow_up_message, inmail, profile_view, profile_follow, post_like_comment, withdraw_connection_request.
audienceDataNoAudience descriptor matching audienceSource. linkedin_urls: { urls: ["https://www.linkedin.com/in/..."] }. csv: { rows: [...] }. lead_list: { listId }. linkedin_search: { url } with a Sales Navigator PEOPLE search URL (linkedin.com/sales/search/people...); a regular linkedin.com/search URL or a company search returns no people. The search runs on the campaign's first sending account, which needs Sales Navigator. Imports at launch: the first ~125 people land right away, then the rest arrive in the background (~200 every half minute) until the search runs out or reaches ~2,500 people (Sales Navigator's own cap). So the campaign's prospect count keeps rising for several minutes after launch; that is the import, not a problem. Changing the url starts a fresh import and stops the old one.
audienceSourceNoWhere leads come from. Most common: linkedin_urls.
sourceLanguageNoThe language the sequence copy is written in, ISO 639-1 ("" = let the server detect it). Prospects who'd get this language receive the copy as written, and a fixed `language` equal to it needs no translations. Copy may mix languages (e.g. Arabic with English terms): name the main one.
idempotency_keyNoOptional UUID for safe retries: send the same key when repeating a request so it is applied once.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / audienceData / description
      Previous value: -"Audience descriptor matching audienceSource. linkedin_urls: { urls: [\"https://www.linkedin.com/in/...\"] }. csv: { rows: [...] }. lead_list: { leadListId }. linkedin_search: { url } with a Sales Navigator PEOPLE search URL (linkedin.com/sales/search/people...); a regular linkedin.com/search URL or a company search returns no people. The search runs on the campaign's first sending account, which needs Sales Navigator. Imports at launch: the first ~125 people land right away, then the rest arrive in the background (~200 every half minute) until the search runs out or reaches ~2,500 people (Sales Navigator's own cap). So the campaign's prospect count keeps rising for several minutes after launch; that is the import, not a problem. Changing the url starts a fresh import and stops the old one."New value: +"Audience descriptor matching audienceSource. linkedin_urls: { urls: [\"https://www.linkedin.com/in/...\"] }. csv: { rows: [...] }. lead_list: { listId }. linkedin_search: { url } with a Sales Navigator PEOPLE search URL (linkedin.com/sales/search/people...); a regular linkedin.com/search URL or a company search returns no people. The search runs on the campaign's first sending account, which needs Sales Navigator. Imports at launch: the first ~125 people land right away, then the rest arrive in the background (~200 every half minute) until the search runs out or reaches ~2,500 people (Sales Navigator's own cap). So the campaign's prospect count keeps rising for several minutes after launch; that is the import, not a problem. Changing the url starts a fresh import and stops the old one."
  2. Changed2 schema fields changed
    • changedInput schema / properties / dailyLimits / description
      Previous value: -"Daily caps for THIS CAMPAIGN, e.g. { connection_invite: 20, follow_up_message: 30 }. Each number is a total per day across every sender on the campaign, not per account, and not a range the runner varies. Each sending account ALSO has its own daily caps (get_account_daily_limits); a send needs room under both, so the lower one governs. Omit to leave the campaign uncapped, in which case the account limits alone govern, that is a safe default and usually the right one. Unknown action keys are rejected by the API rather than ignored, so spell them exactly: connection_invite, follow_up_message, inmail, profile_view, profile_follow, post_like_comment, withdraw_connection_request."New value: +"Daily caps for THIS CAMPAIGN, e.g. { connection_invite: 20, follow_up_message: 30 }. Each number is a total per day across every sender on the campaign, not per account, and not a range the runner varies. Each sending account ALSO has its own daily caps (get_account with include daily_limits); a send needs room under both, so the lower one governs. Omit to leave the campaign uncapped, in which case the account limits alone govern, that is a safe default and usually the right one. Unknown action keys are rejected by the API rather than ignored, so spell them exactly: connection_invite, follow_up_message, inmail, profile_view, profile_follow, post_like_comment, withdraw_connection_request."
    • changedInput schema / properties / sequence / items / properties / variants / description
      Previous value: -"A/Z test (connection_request/message/follow_up/inmail): EXTRA message variants beyond `body`. `body` is Variant A; these are the extras. When 1+ is present, sends split evenly across [body, ...variants] and the campaign tracks reply/accept rate per variant (see get_campaign_ab_stats). Omit for no test."New value: +"A/Z test (connection_request/message/follow_up/inmail): EXTRA message variants beyond `body`. `body` is Variant A; these are the extras. When 1+ is present, sends split evenly across [body, ...variants] and the campaign tracks reply/accept rate per variant (see get_campaign_stats with include ab_tests). Omit for no test."
  3. First observed

TDQS

A4.3/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations only declare readOnlyHint=false and destructiveHint=false, which is accurate but thin for a create operation. The description adds substantive behavior: launch validation returning structured errors, launches refused while [bracketed placeholders] remain, unregistered {{token}}s silently stripped at send time, and active status activating immediately. It says less about the created object's return shape, side effects on existing campaigns, or whether creation is reversible, so it stops at a solid rather than exceptional 3.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the workflow, then sequence shape, then per-step-type rules, then the example — a sensible order. It is long, and several paragraphs (like_post config, voice_note requirements, A/Z variants) restate schema descriptions nearly verbatim, which is wasted length given the 100% schema coverage.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For an 11-parameter, deeply nested create tool with no output schema, the description covers the hard parts: how to build the tree, what blocks launch, and where to validate first. Parameters like audienceData, dailyLimits, schedule, and accountIds are not discussed in the description, but their schema descriptions are thorough enough that this is not a practical gap. Return value expectations remain unstated, though for a create call that is mostly inferable.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3, but the description earns above baseline by supplying a concrete worked example of the sequence array, naming the valid branch keys (accepted/notAccepted, no replied/noReply), and warning that an unregistered token leaves a silent hole. The escape-run explanation for literal braces is meaning the agent would not derive from the schema alone.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Create a new outreach campaign, including the full branching sequence') and immediately scopes what 'create' entails (the whole step tree, not just metadata). That distinguishes it clearly from update_campaign and from create_campaign_from_template, which the workflow section implicitly routes to via list_sequence_templates.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives an explicit numbered workflow: list_sequence_templates first, fork, edit, validate_sequence, preview_sequence/preview_messages, then create_campaign only after user confirmation. It names the specific alternative tools and the conditions that select them, plus the draft-vs-active decision point. This is about as prescriptive as usage guidance gets.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources