Count Segment
count_segmentRefresh the stored record_count of one saved segment, not its parent audience. Runs a fresh BigQuery count over the segment's own definition for any subtype (filter, matched, custom), updates segment.record_count. Returns {segment_id, record_count}. For an unsaved population preview use discovery_count; for a composed audience snapshot use recount_audience. Requires 'discovery' scope.
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": {
"segment_id": "<segment_id>"
},
"name": "count_segment"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| segment_id | Yes | The segment ID to recount |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| guidance | No | Interpretation or recovery guidance for this result | |
| count_unit | No | ||
| page_count | No | Number of objects on this page, not the organization total | |
| segment_id | Yes | ||
| count_state | No | Unknown means no count; available does not guarantee freshness. Recount for a current value. | |
| next_actions | No | Suggested next calls using returned IDs and available scopes. Not executed and not user consent. | |
| record_count | Yes | Fresh segment count, or null when pending or failed | |
| population_input | No | Population input used for the preview; IDs refer to their current saved definitions |