Skip to main content
Glama

Save a segment

save_segment
DestructiveIdempotent

Save a named set of filters as a segment, so the team can apply it in the dashboard's Segments menu. A segment with the same name (case-insensitive) is replaced. Needs member or owner access. Use the same filters shape as the other tools.

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": {
      "name": "<name>",
      "filters": "<filters>"
    },
    "name": "save_segment"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYesShort name, e.g. "Returning visitors from Europe".
siteNoSite domain (example.com), id or public id (tb_…). Optional with a site key, or when the account has one site.
filtersYesAt least one filter, e.g. {"channel": ["Paid Search", "Paid Social"], "country": {"is_not": "US"}}.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / filters / propertyNames / enum
      Previous value: -[
      -  "channel",
      -  "referrer",
      -  "campaign",
      -  "keyword",
      -  "source",
      -  "hostname",
      -  "entry",
      -  "exit",
      -  "country",
      -  "region",
      -  "city",
      -  "browser",
      -  "os",
      -  "device",
      -  "page",
      -  "goal",
      -  "visitor",
      -  "ad"
      -]New value: +[
      +  "channel",
      +  "referrer",
      +  "campaign",
      +  "keyword",
      +  "source",
      +  "hostname",
      +  "entry",
      +  "exit",
      +  "country",
      +  "region",
      +  "city",
      +  "browser",
      +  "os",
      +  "device",
      +  "page",
      +  "goal",
      +  "visitor",
      +  "ad",
      +  "assistant"
      +]
  2. First observed

TDQS

A4.4/5.0
Behavior5/5

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

Beyond the annotations' destructiveHint=true, the description explains exactly what is destroyed and under what condition — a same-named segment is replaced, matched case-insensitively — plus the access requirement the annotations cannot express. That is genuinely new decision-relevant context rather than restated flags.

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

Conciseness5/5

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

Three tight sentences, front-loaded with the action and outcome, then the replacement rule, then the access prerequisite. Nothing is redundant and no sentence could be dropped without losing information.

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 nested-schema mutation with annotations and no output schema, the definition covers write semantics, identity matching, and permissions. The only minor gap is that the optional site parameter is never mentioned, and no return-value expectation is set for a save operation.

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?

The description only says to reuse the filters shape used by other tools; the schema itself documents the filter keys, the is/is_not/contains operators, and the name constraint with an example. With 100% schema description coverage, the description adds no syntax or semantics beyond the structured data, so the baseline 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 gives a specific verb and resource ("Save a named set of filters as a segment") and states the outcome — availability in the dashboard's Segments menu. That clearly separates it from delete_segment, which is the only close sibling, without needing to open either schema.

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 conveys usage context (the team applies the segment from the Segments menu), states a hard prerequisite ("Needs member or owner access"), and points to a cross-tool convention for the filters shape. It stops short of explicit when-not-to-use guidance or naming delete_segment as the inverse operation.

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