Skip to main content
Glama

Create a segment

create_segment
Destructive

Save a group of users defined by rules, all of which must match. Rule fields: plan, country, role, status, verified, email, name, joinedAt, lastActiveAt, lastLoginAt, meta., metric.. Operators: eq, neq, gt, gte, lt, lte, contains, in, is_null, not_null, older_than_days, within_days.

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>",
      "rules": "<rules>"
    },
    "name": "create_segment"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYes
rulesYes
descriptionNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3.1/5.0
Behavior2/5

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

Annotations already declare readOnlyHint=false, openWorldHint=false and destructiveHint=true, so the safety profile is largely covered. Beyond that the description adds no behavior: it does not say whether names must be unique, whether the segment is immediately queryable, what errors arise from invalid fields/operators, or whether/how a created segment can later be modified or removed — relevant since destructiveHint is flagged on a creation tool.

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?

Two tight sentences: the first front-loads the core semantics (a saved group, AND-combined rules), the second is a dense, scannable enumeration of fields and operators. No filler, though the operator list is prose rather than structured and is easy to misparse.

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?

For a 3-parameter creation tool with no output schema, the rule vocabulary is the critical missing piece and is delivered. However, the mutation side is thin — no note on persistence, uniqueness of `name`, validation failures, or how the new segment is later consumed — leaving an agent unable to predict outcomes or recover from errors.

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 0% and `op`/`field` are untyped free-form strings with no enums, so the description carries the load — and it does so well by enumerating every valid field (including meta.<field> and metric.<key>) and all twelve operators. It still omits the `name` and `description` parameters and does not tie operators to expected `value` shapes (e.g. is_null taking none, in taking an array, older_than_days taking a number).

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?

"Save a group of users defined by rules" states a specific verb (save/create) and resource (a rule-based group of users), so an agent knows exactly what this tool produces. It does not name or distinguish itself from siblings such as list_segments or get_segment_members, so it stops short of a 5.

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

Usage Guidelines2/5

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

The description says nothing about when to reach for this over alternatives (list_segments, find_users_at_risk, get_segment_members) or when-not to use it. The only usage-relevant statement is the AND semantics of rules, which is a rule-construction constraint rather than call guidance.

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.