create_audience_from_segment
Create a new custom audience based on a segment from the insights/attribution tool.
Writes audiences
Creates or changes something in the account. Put it behind whatever review your agent uses.
What it does
Create a new custom audience based on a segment from the insights/attribution tool.
This tool creates a website retargeting audience using segment data from the list_segments tool.
The audience will include accounts that match the segment criteria within the specified lookback window.
**IMPORTANT - TWO-STEP WORKFLOW FOR CREATING AUDIENCES FROM INSIGHTS:**
When a user asks to "create an audience from the insights report" or "create an audience based on insights data":
STEP 1: Create a segment first using create_segment tool
- Use search_insights_criteria_fields to find the appropriate fields for filtering
- Build the criteria object based on the user's filtering requirements
- Call create_segment with the criteria to save the segment
- Get the segment_id from the response
STEP 2: Create the audience from the segment using this tool
- Use the segment_id from Step 1
- **IMPORTANT**: Verify the segment status is READY (check using get_segment_criteria)
- Provide a descriptive audience name
- Set the lookback window (number of days)
- Call this tool to create the audience
This two-step process is necessary because audiences must be based on saved segments, not raw criteria.
SEGMENT STATUS REQUIREMENT:
The segment MUST have a status of READY before creating an audience from it.
If the segment status is PENDING or FAILED, the audience creation will fail.
Use get_segment_criteria to check the segment status before proceeding.
**USE THIS TOOL WHEN THE USER ASKS TO:**
- "Create an audience from segment [segment_name or segment_id]"
- "Make an audience based on segment [segment_name or segment_id]"
- "Turn segment [segment_name or segment_id] into an audience"
- "Create a custom audience from [segment_name or segment_id]"
- "Create an audience from the insights report" (requires creating segment first)
- "Create an audience based on insights data" (requires creating segment first)
WORKFLOW:
1. Use list_segments tool to find available segments and their IDs (OR create new segment if needed)
2. Ask user for the audience name if not provided
3. Ask user for the lookback window (days) if not provided
4. Create the audience using the segment ID
PARAMETERS:
- segment_id: The ID of the segment from list_segments tool (required)
- name: Name for the new audience (required)
- lookback_window: Number of days to look back in the segment results (required)
Range: 1 to 365 days
Example: 30 (last 30 days), 90 (last 90 days), 365 (last year)
COMMON USE CASES:
- Create retargeting audiences from high-intent segments
- Build audiences from engagement score segments
- Create audiences from behavioral pattern segments
- Generate audiences from CRM status segments
SEGMENT ID SOURCES:
Use the list_segments tool to find segment IDs:
- List all available segments
- Find the segment by name
- Get the segment ID from the results
EXAMPLE WORKFLOW:
User: "Create an audience from the high intent segment for the last 30 days"
1. Call list_segments() to find "high intent" segment → get segment_id (e.g., 86)
2. Ask for audience name if not provided → "High Intent Accounts - 30 Days"
3. Call this tool with segment_id=86, name="High Intent Accounts - 30 Days", lookback_window=30
RETURNS:
Success confirmation with details about the created audience including:
- Audience ID
- Audience name
- Segment ID used
- Lookback window configured
- Estimated audience size
IMPORTANT NOTES:
- **Segment status MUST be READY** - verify using get_segment_criteria before creating the audience
- Segment ID must exist and be valid
- Lookback window must be between 1 and 365 days
- Audience name must be unique
- The audience type is automatically set to WEBSITE_RETARGETING
- Audience will update automatically as segment data changesArguments
| Argument | Type | Notes | |
|---|---|---|---|
segment_id |
integer | required | The ID of the segment from list_segments tool. Use list_segments to find available segment IDs. |
name |
string | required | Name for the new audience. Must be unique and descriptive. Example: 'High Intent Accounts - 30 Days' |
lookback_window |
integer | required | Number of days to look back in the segment results. Range: 1 to 365 days. Example: 30 for last 30 days, 90 for last quarter, 365 for last year. |
Request
curl
curl -s -X POST https://mcp-server.metadata.io/mcp \
-H "Authorization: $METADATA_PAT" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-H "MCP-Protocol-Version: 2025-11-25" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"create_audience_from_segment","arguments":{"segment_id":0,"name":"<name>","lookback_window":0}}}'
Response
No recorded response. This tool writes to the account, so it is never executed to build these docs.
The request above is still the exact shape to send. Nothing on this page is invented.
Related
Other audiences tools: