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 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.

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 (or search_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

A5/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, so safety is covered. The description goes far beyond by disclosing platform behaviors: the LINKEDIN location-first constraint, pre-flight rejection of placeholder values and inactive audiences, silent dropping of Target Groups, and the possibility of zero estimates for server-resolved audiences. These are non-obvious behaviors that materially affect invocation success, and they are all clearly stated.

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

Conciseness5/5

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

Although long, the description is exceptionally well-structured with clear uppercase section headers (USE FOR, CHANNELS, PREREQUISITE, TARGETING STRUCTURE, etc.) and front-loaded purpose. Every section contains actionable, non-redundant information. The length is appropriate for the tool's complexity, and the structure makes it easy to scan. It is not verbose for verbosity's sake.

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?

This tool has nested objects, no output schema, and complex constraints. The description covers all of it: the response shape is explicitly given ({matchCount, isMatchCountTooSmall, matchCountType, allowZeroMatchCount}), the workflow is spelled out (search → build → estimate → adjust → create), and edge cases (Reddit, Custom Audience vs Target Group, inactive audiences) are handled. Nothing an agent needs for correct invocation is missing.

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?

Schema coverage is 100%, but the description adds enormous semantic depth. It provides a complete JSON example of the targeting structure, explains that exclude is an object (not an array), defines the meanings of include blocks (AND-groups), documents the exact shape of audience records, enumerates criterion types, and specifies which types are valid in exclude vs include. This far exceeds the minimal schema descriptions and prevents common invocation errors.

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: 'Estimate audience size for target group criteria before creating.' It explicitly lists use cases ('Validate audience size before creating', 'how many people will this reach?') and differentiates from siblings by naming the channels (LINKEDIN vs REDDIT) and prerequisites (search_target_group_criteria, search_reddit_criteria). This clearly distinguishes it from create_target_group, update_target_group, and search tools.

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 description provides an explicit 'USE FOR' section and a 'PREREQUISITE' section, telling the agent exactly when to call this tool and that criteria IDs must come from search_target_group_criteria (or search_reddit_criteria for REDDIT). It also gives channel-specific instructions (pass channel='REDDIT') and warns against confusing Custom Audiences with Target Groups, directing the agent to get_matched_audiences when needed. This is textbook when/when-not guidance.

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