Skip to main content
Glama

List segments and tags

list_segments
Read-onlyIdempotent

Use this when you need the real segments and tags of a project: every saved segment (with its live matching count) and every tag (with how many contacts carry it). Use it before tag_contacts, untag_contacts, create_segment or preview_segment, so you choose a real handle rather than guessing a name. Not for checking an unsaved filter (use preview_segment) or for finding people (use search_audience).

A segment's id (seg_…) is what preview_segment, create_segment's rules, and the segment argument on tag_contacts/untag_contacts all take; a tag's id (tag_…) is what those same tools' tag argument takes (or just pass its name: an unrecognised name creates a new tag on tag_contacts only). count is the live number of contacts a segment currently matches, computed fresh, never a stale cached figure.

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": {
      "project": "<project>"
    },
    "name": "list_segments"
  }
}

Input Schema

NameRequiredDescriptionDefault
projectYesThe project handle, like `prj_…`.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive, but the description still adds real behavior: counts are 'computed fresh, never a stale cached figure', and an unrecognised tag name creates a new tag on tag_contacts only. That hidden side-effect disclosure is genuinely useful. Slightly short of 5 only because return ordering/pagination is unmentioned.

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-loaded with purpose and gated by a when-not clause, then a second paragraph mapping id formats to consuming tools. Dense and mostly earned, though the parenthetical about unrecognised tag names is packed into an already long sentence.

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?

No output schema exists, so the description takes on return-value duty and does it: it names both record types and the count each carries. Combined with usage routing and id semantics, an agent has everything needed to call it and use the result.

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?

Only one parameter (project) and schema coverage is 100%, so the schema already carries the meaning. The description instead explains identifier formats (seg_…, tag_…) for downstream tools, which is valuable context but not about this tool's own input, 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?

Specific verb+resource: 'the real segments and tags of a project', with explicit enumeration of what is returned (every saved segment with live matching count, every tag with contact count). It distinguishes itself from preview_segment and search_audience by name, so an agent can route without opening a schema.

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

Usage Guidelines5/5

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

States when to use it ('before tag_contacts, untag_contacts, create_segment or preview_segment, so you choose a real handle rather than guessing a name') and when not to ('Not for checking an unsaved filter (use preview_segment) or for finding people (use search_audience)'). Both positive and negative routing are explicit.

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.