Skip to main content
Glama

Metadata MCP Connector

Estimate Target Group

estimate_target_group
Read-only

Estimate audience size for target group criteria before creating. Supports BOTH include AND exclude rules (criteria + audiences).

USE FOR: Validate audience size before creating, "how many people will this reach?", "preview audience size", test targeting combinations, preview impact of exclusion criteria/audiences.

CHANNELS: LINKEDIN (default) and REDDIT. Pass channel="REDDIT" to size a Reddit target group before create_reddit_target_group; its criteria ids come from search_reddit_criteria rather than search_target_group_criteria, and the rest of the call is identical (PRD-31759).

PREREQUISITE: All criteria IDs MUST come from search_target_group_criteria first (search_reddit_criteria for REDDIT).

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: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. Each block = AND-group of criteria; multiple blocks are AND'd together. EXCLUDE: Single object (NOT array) with criteria and audiences. Anyone matching exclude is removed from results.

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 the audience tool schemas 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.

EXCLUDE AUDIENCES: To exclude an existing Metadata Custom Audience, provide its full 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 first and use the real values from the response:

  • 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, required): Audience name.

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

  • matchCount (int), matchCountType ("FIXED_SIZE"), inactive (bool): metadata fields from the 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}

RESPONSE: {matchCount, isMatchCountTooSmall, matchCountType, allowZeroMatchCount}

WORKFLOW: search_target_group_criteria → build targeting (include + optional exclude) → estimate_target_group → adjust → create_target_group

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channelYesChannel to estimate for. LINKEDIN (default) takes criteria ids from search_target_group_criteria; REDDIT takes them from search_reddit_criteria and is estimated the same way (PRD-31759). Omit for LinkedIn.LINKEDIN
targetingNoComplete targeting configuration with include/exclude rules. Structure: { "include": [ { "criteria": [{"type": str, "data": object}], "audiences": [] } ], "exclude": {"criteria": [], "audiences": []} } All criteria IDs/references must come from search_target_group_criteria tool.

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?

Even with readOnlyHint=true present, the description adds substantial behavioral context: it warns that inactive audiences are rejected and sized at 0, target groups are silently dropped/rejected, pre-flight validation rejects placeholder audience values, and estimates may under-report for server-resolved audiences. These are exactly the non-obvious behaviors an agent needs beyond the annotation.

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 the complexity of the tool justifies most of it, and it is well structured with clear section headers (USE FOR, CHANNELS, WARNING, INCLUDE AUDIENCES, EXCLUDE AUDIENCES). It loses a point for some redundancy, e.g. the 'AUDIENCES ≠ TARGET GROUPS' warning is repeated in the EXCLUDE AUDIENCES bullet, and the example JSON plus repeated 'NEVER' lists could be tightened.

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?

No output schema exists, but the description includes the response shape ({matchCount, isMatchCountTooSmall, matchCountType, allowZeroMatchCount}) and closes with a full workflow. It also covers channel differences, prerequisites, include/exclude semantics, audience-vs-target-group pitfalls, and the reconciliation caveat, making the tool callable without additional lookups.

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?

The input schema leaves targeting as generic nested objects, but the description fully specifies the targeting structure, the difference between include (array of AND-groups) and exclude (single object), the required field shapes for audiences, and the valid criteria types. This goes far beyond the 100% schema coverage by adding operational meaning to every nested field.

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?

Opens with a specific verb and resource: 'Estimate audience size for target group criteria before creating.' It also distinguishes this estimation/preview role from the sibling create_target_group and create_reddit_target_group tools, so an agent can immediately tell this is the sizing/preview tool rather than a creation or mutation tool.

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?

The 'USE FOR' section explicitly lists validation and preview scenarios ('how many people will this reach?', 'preview impact of exclusion criteria'), and the CHANNELS section tells the agent when to use REDDIT versus LINKEDIN, including the prerequisite that criteria come from search_reddit_criteria vs search_target_group_criteria. This is explicit when-to-use guidance with named alternatives.

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