Skip to main content
Glama

Update a segment

update_segment
DestructiveIdempotent

Renames a segment or replaces its filters. Needs its current revision from list_segments; if someone changed it since, call list_segments again and retry. Requires the write scope. Segment definitions are private team settings: without the visitors scope (Visitor details) the current values can't be read, so send both name and filters, with the segment_id and revision from the create_segment or last update_segment answer.

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>",
      "revision": "<revision>"
    },
    "name": "update_segment"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameNo
filtersNoThe whole new list of filters (replaces every filter). Up to six visitor filters, all of which must match. op: is, is_not (exact); contains, not_contains, starts_with, ends_with (literal text, letter case ignored); regex, not_regex (case-insensitive regular expressions up to 200 characters, without lookarounds, backreferences or repeated groups like (a+)+); is_empty, is_not_empty (no values: send []; e.g. utmCampaign is_empty = visitors who never had a campaign); gt, lt and is for visits. dim urlParam also needs key, the URL parameter name (one of the site's kept parameters): {"dim":"urlParam","key":"plan","op":"is","values":["pro"]}. dim prop (event property) needs key, the property name, and optionally goal to look only at that goal's events; values match as text (numbers and true/false too), and a visitor matches with at least one such event: {"dim":"prop","key":"plan","goal":"signup","op":"is","values":["growth"]} (list_event_properties lists names and values). dim trait needs key, a person's identify trait (get_visitor_traits lists them): {"dim":"trait","key":"role","op":"is","values":["founder"]}. Other dimensions take no key or goal. A 400 filter_too_slow means the regex was too slow: simplify it.
revisionYesThe segment's current revision, from list_segments (or from the last create_segment or update_segment answer).
segment_idYesSegment ID from list_segments (seg_…).
website_idNoWebsite ID from list_websites (the data-site-id value in the tracking script).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already flag destructiveHint=true and idempotentHint=true, but the description adds real context beyond them: the write scope is required, the visitors scope is needed to read current values, and both name and filters must be sent because the stored values cannot be read back. The conflict/retry protocol is also disclosed. Minor gap: the optimistic-concurrency retry requirement is slightly at odds with a plain idempotent reading, and no other error behavior is described.

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?

Purpose is front-loaded in the first sentence, and every remaining sentence carries actionable information (revision source, retry, scopes, send-both rule). The third sentence is dense and chains two scope facts together, but nothing is redundant.

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

Completeness4/5

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

For a destructive mutation with no output schema, the description covers the essentials an agent needs: auth scopes, the revision/conflict protocol, ID sources, and the replace-all semantics of filters. Remaining gaps are limited to return shape and error handling outside the 400 filter_too_slow case, which are lower stakes here.

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 description coverage is 80%, so the baseline is 3 and the heavy filter/enum documentation is already in the schema. The description does add one genuinely useful clarification the schema lacks: although only segment_id and revision are marked required, the agent must send both name and filters. Otherwise it adds no per-parameter meaning beyond what the schema states.

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?

"Renames a segment or replaces its filters" gives a specific verb pair plus resource, and the partial-update distinction (rename vs. filter replacement) is stated up front. It is clearly separable from create_segment and list_segments, the latter of which is named as the source of the revision.

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 tells the agent the prerequisite (current revision from list_segments) and gives an explicit recovery path: if someone changed it since, call list_segments again and retry. It also names create_segment as a source of segment_id/revision. What it does not do is state when to prefer this over create_segment for creating a new segment, so alternatives are referenced but not fully contrasted.

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