Skip to main content
Glama
This connector has been deprecated

Replaced by io.github.no-fait/infinite-audience

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, custom) — non-filter subtypes resolve via the same underlying ID-set composition audiences use. Results may populate a 20-minute server-side cache and record query telemetry; the segment definition is unchanged. 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": "get_segment_demographics"
  }
}

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
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"
      +    },
      +    "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
Behavior5/5

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

Goes well past the annotations by disclosing the required 'discovery' scope, the 20-minute server-side caching and query telemetry side effects, that the segment definition itself is unchanged, and how non-filter subtypes (matched, custom) resolve via ID-set composition. That explains why readOnlyHint=false despite an apparently read-like operation.

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

Conciseness3/5

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

The purpose is front-loaded and the sentences carry real content, but the no-set-logic/no-exclusions point is stated twice in near-identical wording ('without any audience set logic or exclusions' then 'no audience composition (set_logic/exclusions) applied'), which pads an otherwise dense paragraph.

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?

An output schema exists, yet the description still characterizes the returned breakdown (age buckets, geography, behavioral/financial extra) and covers auth, caching, subtype handling, and non-mutation of the segment. Nothing an agent needs to call this correctly is missing.

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

Parameters4/5

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

Schema coverage is 100% and there is a single parameter, so the baseline is already high. The description still adds meaning by clarifying that the ID may belong to any subtype (filter, matched, custom) and how non-filter IDs are resolved, which the schema's one-line description does not convey.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb ('Profile') and resource ('one saved segment') and scopes it explicitly to the segment-only path, contrasting with the audience path where composition applies. It never names the sibling get_audience_demographics, so differentiation is inferable rather than explicit.

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?

The 'on its own, without any audience set logic or exclusions' framing tells the agent this is the right call when only the raw segment definition, not a composed audience, should be profiled. It does not explicitly say 'use get_audience_demographics instead when…', so the alternative routing is left implicit.

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