Skip to main content
Glama

Get Segment

get_segment
Idempotent

Fetch one segment by segment_id. Returns its customer-facing subtype, status, count, and subtype-specific fields. Filter segments include the complete filter_groups definition and current_version; matched and model-generated segments expose their own relevant fields. Use to inspect a definition before modifying or composing it. Requires 'discovery' scope.

Input Schema

NameRequiredDescriptionDefault
segment_idYesThe segment ID to retrieve

Output Schema

NameRequiredDescriptionDefault
nameYes
statusYes
subtypeYes
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.
next_actionsNoSuggested next calls using returned IDs and available scopes. Not executed and not user consent.
record_countNoStored count; null means unknown. Call count_segment for a current count.
record_limitNoMaximum members; null means no explicit cap
filter_groupsNoComplete saved filter definition; one AND group also represents a simple flat filter list
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.
current_versionNo
population_inputNoPopulation input used for the preview; IDs refer to their current saved definitions

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed11 schema fields changed
    • addedOutput schema / properties / count_state
      Added value: +{
      +  "description": "Unknown means no count; available does not guarantee freshness. Recount for a current value.",
      +  "enum": [
      +    "unknown",
      +    "available"
      +  ],
      +  "type": "string"
      +}
    • addedOutput schema / properties / count_unit
      Added value: +{
      +  "const": "records",
      +  "type": "string"
      +}
    • addedOutput schema / properties / current_version
      Added value: +{
      +  "type": "number"
      +}
    • addedOutput schema / properties / filter_groups
      Added value: +{
      +  "description": "Complete saved filter definition; one AND group also represents a simple flat filter list",
      +  "items": {
      +    "additionalProperties": {},
      +    "properties": {
      +      "combinator": {
      +        "description": "Join to the preceding included group; ignored for the first group. AND binds before OR. Exclusion groups always subtract.",
      +        "enum": [
      +          "AND",
      +          "OR"
      +        ],
      +        "type": "string"
      +      },
      +      "filters": {
      +        "items": {
      +          "additionalProperties": {},
      +          "properties": {
      +            "field": {
      +              "description": "field_name from get_field_catalog; ZIP5 also accepts zip, zip_code or postal_code. Use published operators and enum_values",
      +              "minLength": 1,
      +              "type": "string"
      +            },
      +            "op": {
      +              "enum": [
      +                "=",
      +                "!=",
      +                "<",
      +                "<=",
      +                ">",
      +                ">=",
      +                "IN",
      +                "NOT IN",
      +                "BETWEEN",
      +                "LIKE",
      +                "ARRAY_CONTAINS",
      +                "ARRAY_CONTAINS_ANY",
      +                "IS NULL",
      +                "IS NOT NULL"
      +              ],
      +              "type": "string"
      +            },
      +            "text_comparison": {
      +              "description": "STRING =, !=, IN, NOT IN, LIKE and ARRAY<STRING> ARRAY_CONTAINS, ARRAY_CONTAINS_ANY. Default exact. case_insensitive applies Unicode case folding to stored text and the supplied value; use when capitalization is incidental.",
      +              "enum": [
      +                "exact",
      +                "case_insensitive"
      +              ],
      +              "type": "string"
      +            },
      +            "trim_whitespace": {
      +              "description": "Supported STRING or ARRAY<STRING> comparisons only. Trim leading/trailing whitespace on both sides; default false.",
      +              "type": "boolean"
      +            },
      +            "value": {
      +              "anyOf": [
      +                {
      +                  "type": "string"
      +                },
      +                {
      +                  "type": "number"
      +                },
      +                {
      +                  "type": "boolean"
      +                },
      +                {
      +                  "items": {
      +                    "anyOf": [
      +                      {
      +                        "type": "string"
      +                      },
      +                      {
      +                        "type": "number"
      +                      },
      +                      {
      +                        "type": "boolean"
      +                      }
      +                    ]
      +                  },
      +                  "type": "array"
      +                },
      +                {
      +                  "type": "null"
      +                }
      +              ],
      +              "description": "Scalar for comparisons; array for IN/NOT IN; ARRAY_CONTAINS_ANY matches any listed value; [lower, upper] inclusive for BETWEEN; LIKE uses % for any sequence and _ for one character; omit for IS NULL/IS NOT NULL. Use enum_values codes, not display labels"
      +            }
      +          },
      +          "required": [
      +            "field",
      +            "op"
      +          ],
      +          "type": "object"
      +        },
      +        "type": "array"
      +      },
      +      "id": {
      +        "description": "Caller-chosen group ID, for example geography; prefix _exclude:: to subtract this group",
      +        "minLength": 1,
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "id",
      +      "combinator",
      +      "filters"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
    • addedOutput schema / properties / guidance
      Added value: +{
      +  "description": "Interpretation or recovery guidance for this result",
      +  "type": "string"
      +}
    • addedOutput schema / properties / money_display
      Added value: +{
      +  "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"
      +}
    • addedOutput schema / properties / next_actions
      Added value: +{
      +  "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"
      +}
    • addedOutput schema / properties / page_count
      Added value: +{
      +  "description": "Number of objects on this page, not the organization total",
      +  "maximum": 9007199254740991,
      +  "minimum": -9007199254740991,
      +  "type": "integer"
      +}
    • addedOutput schema / properties / population_input
      Added value: +{
      +  "additionalProperties": {},
      +  "description": "Population input used for the preview; IDs refer to their current saved definitions",
      +  "propertyNames": {
      +    "type": "string"
      +  },
      +  "type": "object"
      +}
    • addedOutput schema / properties / record_count
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "number"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "Stored count; null means unknown. Call count_segment for a current count."
      +}
    • addedOutput schema / properties / record_limit
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "number"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "Maximum members; null means no explicit cap"
      +}
  2. First observed

TDQS

B3.4/5.0
Behavior1/5

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

The description presents a pure read operation ('Fetch', 'inspect'), while annotations declare readOnlyHint=false, indicating the tool is not read-only. That is a direct contradiction; although scope and return-shape context are provided, the annotation conflict dominates the behavioral assessment.

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?

The description is front-loaded with the core action and then adds return-shape and scope details. It is somewhat long for a one-parameter read tool, especially since an output schema exists, but the sentences are purposeful.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

It covers the required parameter, return content, and auth scope, and an output schema exists. However, it does not address the non-read-only behavior implied by readOnlyHint=false, leaving a meaningful behavioral gap.

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?

Schema coverage is 100%, and the single segment_id parameter is fully documented in the schema. The description says the segment is fetched 'by segment_id' but adds no format or constraint details beyond the schema, so the 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?

The description uses a specific verb and resource: 'Fetch one segment by segment_id.' It also clarifies the scope by saying one segment is retrieved, which naturally distinguishes this from list_segments and related mutation tools.

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?

It gives a clear positive use case: 'Use to inspect a definition before modifying or composing it,' and notes the required 'discovery' scope. It does not explicitly name when not to use it or point to specific alternatives such as list_segments or patch_segment.

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