Skip to main content
Glama

Get Segment Demographics

get_segment_demographics

Profile one saved segment on its own, without any audience set logic or exclusions. Returns a BigQuery-computed demographic breakdown (age buckets, geography, and a behavioral/financial extra when available) evaluated directly over the segment's own definition — the segment-level path, with no audience composition (set_logic/exclusions) applied. Works for any subtype (filter, matched, similarity, propensity) — non-filter subtypes resolve via the same underlying ID-set composition audiences use. Results are cached server-side for 20 minutes. Requires 'discovery' scope.

Input Schema

NameRequiredDescriptionDefault
segment_idYesThe segment ID to retrieve demographics for

Output Schema

NameRequiredDescriptionDefault
guidanceNoInterpretation or recovery guidance for this result
count_unitNo
page_countNoNumber of objects on this page, not the organization total
segment_idYes
count_stateNoUnknown means no count; available does not guarantee freshness. Recount for a current value.
extra_fieldNo
total_countYes
generated_atYesISO timestamp of the demographic snapshot
next_actionsNoSuggested next calls using returned IDs and available scopes. Not executed and not user consent.
segment_nameYes
age_breakdownYes
geo_breakdownYes
money_displayNoCurrency amounts formatted once from source paths ending in _cents. Use verbatim; do not divide again. Null/missing source amounts are omitted, not zero.
breakdown_extraNo
population_inputNoPopulation input used for the preview; IDs refer to their current saved definitions

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": {},
      +  "properties": {
      +    "age_breakdown": {
      +      "items": {
      +        "additionalProperties": {},
      +        "properties": {
      +          "label": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "label"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "breakdown_extra": {
      +      "items": {
      +        "additionalProperties": {},
      +        "properties": {
      +          "label": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "label"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "count_state": {
      +      "description": "Unknown means no count; available does not guarantee freshness. Recount for a current value.",
      +      "enum": [
      +        "unknown",
      +        "available"
      +      ],
      +      "type": "string"
      +    },
      +    "count_unit": {
      +      "const": "records",
      +      "type": "string"
      +    },
      +    "extra_field": {
      +      "type": "string"
      +    },
      +    "generated_at": {
      +      "description": "ISO timestamp of the demographic snapshot",
      +      "type": "string"
      +    },
      +    "geo_breakdown": {
      +      "items": {
      +        "additionalProperties": {},
      +        "properties": {
      +          "label": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "label"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "guidance": {
      +      "description": "Interpretation or recovery guidance for this result",
      +      "type": "string"
      +    },
      +    "money_display": {
      +      "additionalProperties": {
      +        "type": "string"
      +      },
      +      "description": "Currency amounts formatted once from source paths ending in _cents. Use verbatim; do not divide again. Null/missing source amounts are omitted, not zero.",
      +      "propertyNames": {
      +        "type": "string"
      +      },
      +      "type": "object"
      +    },
      +    "next_actions": {
      +      "description": "Suggested next calls using returned IDs and available scopes. Not executed and not user consent.",
      +      "items": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "arguments": {
      +            "additionalProperties": {},
      +            "propertyNames": {
      +              "type": "string"
      +            },
      +            "type": "object"
      +          },
      +          "reason": {
      +            "type": "string"
      +          },
      +          "tool": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "tool",
      +          "arguments",
      +          "reason"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "page_count": {
      +      "description": "Number of objects on this page, not the organization total",
      +      "maximum": 9007199254740991,
      +      "minimum": -9007199254740991,
      +      "type": "integer"
      +    },
      +    "population_input": {
      +      "additionalProperties": {},
      +      "description": "Population input used for the preview; IDs refer to their current saved definitions",
      +      "propertyNames": {
      +        "type": "string"
      +      },
      +      "type": "object"
      +    },
      +    "segment_id": {
      +      "type": "string"
      +    },
      +    "segment_name": {
      +      "type": "string"
      +    },
      +    "total_count": {
      +      "type": "number"
      +    }
      +  },
      +  "required": [
      +    "total_count",
      +    "age_breakdown",
      +    "geo_breakdown",
      +    "generated_at",
      +    "segment_id",
      +    "segment_name"
      +  ],
      +  "type": "object"
      +}
  2. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Adds context beyond the annotations: server-side caching for 20 minutes, the required 'discovery' scope, and that non-filter subtypes resolve through the same ID-set composition used by audiences. This is useful operational detail. It does not, however, explain why annotations mark the tool as non-read-only and non-idempotent (presumably BigQuery job cost), leaving a small gap between declared hints and described behavior.

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?

Front-loads the core scope in the first sentence and keeps the remainder dense with substantive detail. Minor redundancy: 'without any audience set logic or exclusions' and 'no audience composition (set_logic/exclusions) applied' restate the same exclusion twice.

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?

With an output schema present, the description needn't enumerate return fields, yet it still summarizes them (age buckets, geography, optional behavioral/financial extra). Combined with caching, scope, and subtype handling, an agent has everything needed to call this correctly.

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

Parameters3/5

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

There is only one parameter and schema description coverage is 100%, so the schema already fully documents segment_id. The description adds no format, sourcing, or validation detail about the ID, so baseline 3 applies.

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?

States a specific verb and resource ('Profile one saved segment') and pins down the scope precisely: demographics computed over the segment's own definition with no audience composition. The contrast with the audience-level path implicitly separates it from siblings like get_audience_demographics and get_segment.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Makes clear this is the segment-level path with no set_logic/exclusions applied, which tells an agent when to pick it over an audience-composition tool, and it notes applicability to all subtypes (filter, matched, similarity, propensity). It stops short of naming the alternative sibling explicitly ('use get_audience_demographics instead when...'), so a 4 rather than a 5.

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