Skip to main content
Glama

Metadata MCP Connector

Create Target Group

create_target_group

Create a new target group with name and targeting criteria. Supports BOTH include AND exclude rules — including excluding existing Metadata audiences.

PREREQUISITE: All criteria IDs MUST come from search_target_group_criteria. estimate_target_group first is MANDATORY: verify isMatchCountTooSmall=false and report the reach to the user BEFORE creating. A target group created without an estimate can land at zero matches and nothing downstream will notice (PRD-31759). Same bar as update_target_group.

USE FOR: "create target group named X with criteria Y", "save this target group as X", "create new audience called X", "create target group excluding companies Z", "create target group that excludes audience X".

WARNING: CHANNEL: This tool creates LINKEDIN target groups only. Do NOT infer channel from the underlying audience NAMES (e.g. an audience called "Reddit Conquest Mktg LI_n7q" does NOT mean the user wants a REDDIT target group — audience naming is human convention, not a routing signal). Use REDDIT only when the user explicitly named the REDDIT channel in the request; in that case use create_reddit_target_group instead. When in doubt, ask the user which channel.

CRITICAL FOR LINKEDIN: LOCATION must be FIRST criteria in include array with isModifiable=false.

TARGETING STRUCTURE (full example with include + exclude criteria + exclude audiences): { "include": [ { "isModifiable": false, "criteria": [{"type": "NATIVE_LOCATION", "data": [ {"externalId": "urn:li:geo:101165590", "name": "United Kingdom"}, {"externalId": "urn:li:geo:103644278", "name": "United States"} ]}], "audiences": [] }, { "isModifiable": true, "criteria": [{"type": "AGE", "data": [{"externalId": "urn:li:ageRange:(25,34)", "name": "25 to 34"}]}], "audiences": [] } ], "exclude": { "isModifiable": true, "criteria": [ {"type": "COMPANY_NAME", "data": [{"externalId": "urn:li:organization:1090", "name": "Philips"}]} ], "audiences": [ { "mdAudienceId": 45316, "name": "ICP Pharma LifeSci Leaders", "type": "FIRMOGRAPHIC_EXCLUDE", "matchCount": 213127, "matchCountType": "FIXED_SIZE", "inactive": false, "criteria": [{"type": "NATIVE_LOCATION", "data": [{"externalId": "urn:li:geo:103644278", "name": "United States"}]}] } ] } }

INCLUDE: Array of rule blocks (AND-joined). Each block holds a criteria group. EXCLUDE: Single object (NOT array) with criteria and audiences. Anything matching exclude is removed.

WARNING: AUDIENCES ≠ TARGET GROUPS. Both include[].audiences and exclude.audiences accept Custom Audience records ONLY (the entities returned by get_matched_audiences). Target Groups (the entities returned by list_target_groups / retrieve_target_group_by_id) are a separate entity in a separate ID space and CANNOT be attached here; the platform silently drops or rejects them. If the user names "X" and only list_target_groups matches it (not get_matched_audiences), do NOT pass the Target Group's id as mdAudienceId. Stop, tell the user "X is a Target Group, not a Custom Audience", and offer to rebuild X as a Custom Audience (e.g. via create_audiences with the same criteria) before retrying.

INCLUDE AUDIENCES: include[].audiences accepts ANY Metadata audience type — there is NO allow-list and NO restriction to specific types. The audience must be live on the channel, though: a row with inactive=true (LinkedIn segment archived, failed or still building) is refused by the platform and sized at 0, so pick an active row. Pass any audience returned by the audience listing tools (e.g. FIRMOGRAPHIC_INCLUDE, FIRMOGRAPHIC_INCLUDE_SFDC, NATIVE_LINKEDIN, NATIVE_FACEBOOK, RETARGETING, TECHNOGRAPHIC, SFDC_ACCOUNT_DYNAMIC, MA_CONTACTS_DYNAMIC, CONTACT_LIST, and any other type, including types not enumerated in any tool schema). Type-name enums seen in create_audiences / search_audiences describe how audiences are CLASSIFIED, not which can be attached here. Caveat: estimates may under-report (or return zero) when combining server-resolved audiences (e.g. SFDC dynamic, retargeting) with native LinkedIn criteria — that is an estimate-side reconciliation issue, not a creation constraint, so a zero estimate does not necessarily mean the platform will reject the create call. If a zero estimate is suspected to be a reconciliation artifact, attempt the create and verify in the UI.

HOW TO EXCLUDE AN EXISTING METADATA CUSTOM AUDIENCE: Add it as an object in exclude.audiences. The tool pre-flight-rejects placeholder values — never invent ids or types when you don't know them, call get_matched_audiences (or search_audiences) first and use the real values from the response. Required fields:

  • mdAudienceId (integer, REQUIRED): The numeric Custom Audience ID from get_matched_audiences, its customAudienceId / mdAudienceId field (e.g. 49067, 45316), NEVER that row's id (the channel row id). NEVER the audience name string, NEVER a placeholder like 1/2/3/4 (real Custom Audience IDs are 5-digit numbers; the tool rejects anything under 100), and NEVER a Target Group id (those come from list_target_groups; see the AUDIENCES ≠ TARGET GROUPS note above).

  • name (string): Audience name.

  • type (string): MUST be the EXCLUDE variant of the audience type, e.g. FIRMOGRAPHIC_EXCLUDE, RETARGETING_EXCLUDE, CONTACT_LIST_EXCLUDE. NEVER the placeholder string "AUDIENCE" — the tool rejects that pre-flight.

  • matchCount (int), matchCountType ("FIXED_SIZE"), inactive (bool): copy from audience record. The tool pre-flight-rejects entries with inactive: true (an audience still matching after creation cannot be attached yet — attach it once it is active).

  • criteria: The audience's own criteria array (copy from the audience's definition).

CRITERIA TYPES (all IDs from search_target_group_criteria), valid in BOTH include and exclude:

  • NATIVE_LOCATION / LOCATION: location data — MANDATORY FIRST in include. Multi-country geo goes in ONE location criterion with one {externalId, name} entry per country (e.g. "Canada and USA" = 2 entries in the same data array). Never silently drop a country the user named.

  • AGE, COMPANY_CATEGORY, COMPANY_GROWTH_RATE, INDUSTRY, COMPANY_NAME, REVENUE, EMPLOYEE: Array of {externalId, name}

  • JOB_FUNCTION, JOB_TITLE, MEMBER_GROUP, MEMBER_INTEREST, MEMBER_SKILL, MEMBER_BEHAVIOR, SENIORITY, FOLLOWED_COMPANIES: Array of {externalId, name}

  • YEARS_OF_EXPERIENCE_RANGE: {"min": 4, "max": 5}

WORKFLOW: search_target_group_criteria → build targeting (include + optional exclude criteria/audiences) → estimate_target_group → confirm → create_target_group

RESPONSE: {id, name, channel, audienceSize, status, createdDate, targeting}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesThe name for the new target group. Must be unique, descriptive, and UNDER 50 characters — the platform rejects 50+ character names with a 400.
channelYesThe advertising channel for the target group. Only LINKEDIN is currently supported.
targetingNoComplete targeting configuration with include/exclude rules...

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.9/5.0
Behavior5/5

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

With only readOnlyHint=false, destructiveHint=false, and openWorldHint=false, the annotations carry almost no behavioral weight. The description compensates fully: it warns that creating without an estimate can silently land at zero matches (PRD-31759), explains pre-flight rejections of placeholders, notes the platform silently drops Target Groups passed as audiences, and discloses estimate-side reconciliation issues that may require attempting the create anyway.

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?

The description is long but well-organized with bolded section headings (PREREQUISITE, WARNING, TARGETING STRUCTURE, etc.) and front-loads the most critical routing and precreation constraints. There is minor redundancy (location-first appears in both CRITICAL and CRITERIA TYPES), and some sections could be tightened, but the detail directly addresses common failure modes and earns its place for a tool this complex.

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

Completeness5/5

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

The description is comprehensive: it supplies the full workflow, response shape ({id, name, channel, audienceSize, status, createdDate, targeting}), channel-specific guidance, pitfalls with target groups vs audiences, and detailed rules for both include and exclude. Even though there is no output schema, the response fields are stated. Given the complexity of the schema and sparse annotations, this description gives an agent everything needed to call the tool correctly.

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

Parameters5/5

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

Although schema description coverage is 100%, the JSON schema entries are generic ('Complete targeting configuration with include/exclude rules...'). The description adds the real semantics: the full targeting structure example, include as AND‑joined array of blocks vs exclude as single object, required fields for audience entries (mdAudienceId, type, matchCount, etc.), acceptable criteria types, and the mandatory location-first rule. This goes far beyond the schema and is essential for correct invocation.

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?

The description opens with a specific verb and resource: 'Create a new target group with name and targeting criteria.' It clearly distinguishes itself from siblings by stating it supports both include and exclude rules, and explicitly contrasts with create_reddit_target_group and update_target_group in later sections.

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?

Provides explicit USE FOR examples, a mandatory prerequisite workflow (search→estimate→confirm→create), and a strong CHANNEL warning: use create_reddit_target_group only when the user explicitly says REDDIT, otherwise ask. It also names the sibling update_target_group as the same bar for estimation, leaving no ambiguity about when to choose this tool.

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