Skip to main content
Glama

Create, change or delete a candidate segment

manage_segment
Destructive

[Candidates] action save (create without id, update with id; name, description, kind, and rules: the same {match, rules} list_candidates takes, as an object or a JSON string), delete, or add_members / remove_members of a static segment (candidate ids). Fields left out keep their value. list_candidates takes the same rules and returns the candidates they match, without saving anything. Sends nothing to candidates. Deleting cannot be undone.

Every argument in full, with examples: get_tool_reference.

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": {
      "action": "<action>"
    },
    "name": "manage_segment"
  }
}

Input Schema

NameRequiredDescriptionDefault
kindNosave: dynamic (members are the candidates matching the rules at any time) or static (a fixed list). Required when creating; cannot change.
nameNosave: the name (1 to 120 characters). Required when creating; kept when left out on a change.
rulesNosave: the rules of a dynamic segment, or the first members of a new static one (an object, or the same JSON as a string), checked by the database (the candidate search of list_candidates takes the same rules and shows their matches without saving).
actionYessave: create (no segment_id) or change (segment_id) a segment; delete: delete it; add_members / remove_members: change the members of a static segment.
llm_modelNoYour model id, e.g. "claude-opus-4-8"; "unknown" if unsure. For analytics.
segment_idNoSegment id (a segment `id` from list_segments). Required for every action except creating.
descriptionNosave: a description (at most 500 characters); null or empty clears it; kept when left out on a change.
merchant_idNoOptional company to act in. Admins and sub-merchant operators only; other callers always use their token's company.
candidate_idsNoCandidate ids (the `id` of a list_candidates row). add_members / remove_members: the candidates to add or remove (required).
conversation_idNoThe conversation_id this server returned earlier in this conversation, unchanged, including after later user messages. Omit it if you have none. Recorded for the server developer's analytics.

Output Schema

NameRequiredDescriptionDefault
addedNo
actionYes
createdNo
deletedNo
removedNo
segmentNo
segment_idYes
_mcp_instructionsNoServer-issued metadata for this conversation.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / rules / description
      Previous value: -"save: the rules of a dynamic segment (an object, or the same JSON as a string), checked by the database (the candidate search of list_candidates takes the same rules: try them there first)."New value: +"save: the rules of a dynamic segment, or the first members of a new static one (an object, or the same JSON as a string), checked by the database (the candidate search of list_candidates takes the same rules and shows their matches without saving)."
  2. Changed5 schema fields changed
    • changedInput schema / properties / candidate_ids / description
      Previous value: -"Candidate ids (profile_interview.id). add_members / remove_members: the candidates to add or remove (required)."New value: +"Candidate ids (the `id` of a list_candidates row). add_members / remove_members: the candidates to add or remove (required)."
    • removedInput schema / properties / rules / allOf
      Removed value: -[
      -  {
      -    "properties": {
      -      "match": {
      -        "enum": [
      -          "all",
      -          "any"
      -        ],
      -        "type": "string"
      -      },
      -      "rules": {
      -        "items": {
      -          "additionalProperties": {},
      -          "type": "object"
      -        },
      -        "type": "array"
      -      }
      -    },
      -    "required": [
      -      "match",
      -      "rules"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "description": "save: the rules of a dynamic segment, checked by the database (the candidate search of merchant-candidate-list takes the same rules: try them there first)."
      -  }
      -]
    • addedInput schema / properties / rules / anyOf
      Added value: +[
      +  {
      +    "properties": {
      +      "match": {
      +        "enum": [
      +          "all",
      +          "any"
      +        ],
      +        "type": "string"
      +      },
      +      "rules": {
      +        "items": {
      +          "additionalProperties": {},
      +          "type": "object"
      +        },
      +        "type": "array"
      +      }
      +    },
      +    "type": "object"
      +  },
      +  {
      +    "type": "string"
      +  }
      +]
    • addedInput schema / properties / rules / description
      Added value: +"save: the rules of a dynamic segment (an object, or the same JSON as a string), checked by the database (the candidate search of list_candidates takes the same rules: try them there first)."
    • changedInput schema / properties / segment_id / description
      Previous value: -"Segment id (profile_interview_segment.id). Required for every action except creating."New value: +"Segment id (a segment `id` from list_segments). Required for every action except creating."
  3. Changed18 schema fields changed
    • changedInput schema / properties / candidate_ids / description
      Previous value: -"Candidate ids (profile_interview.id). save, creating a static segment: its first members. add_members / remove_members: the candidates to add or remove (required)."New value: +"Candidate ids (profile_interview.id). add_members / remove_members: the candidates to add or remove (required)."
    • addedInput schema / properties / llm_model
      Added value: +{
      +  "description": "Your model id, e.g. \"claude-opus-4-8\"; \"unknown\" if unsure. For analytics.",
      +  "type": "string"
      +}
    • changedInput schema / properties / rules / allOf
      Previous value: -[
      -  {
      -    "description": "With segment_id only: the rules of a dynamic segment (static segments have none).",
      -    "properties": {
      -      "match": {
      -        "description": "all: a candidate matches every rule; any: at least one.",
      -        "enum": [
      -          "all",
      -          "any"
      -        ],
      -        "type": "string"
      -      },
      -      "rules": {
      -        "description": "Up to 20 rules, each { field, op, values | value | days | from | to }, as merchant-candidate-list (rules) accepts them; for example { \"field\": \"tag\", \"op\": \"any\", \"values\": [\"<tag id>\"] }.",
      -        "items": {
      -          "additionalProperties": {},
      -          "type": "object"
      -        },
      -        "type": "array"
      -      }
      -    },
      -    "required": [
      -      "match",
      -      "rules"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "description": "save: the rules of a dynamic segment, checked by the database (the candidate search of merchant-candidate-list takes the same rules: try them there first). When creating a static segment without candidate_ids, the candidates matching these rules now become its members (at most 5000)."
      -  }
      -]New value: +[
      +  {
      +    "properties": {
      +      "match": {
      +        "enum": [
      +          "all",
      +          "any"
      +        ],
      +        "type": "string"
      +      },
      +      "rules": {
      +        "items": {
      +          "additionalProperties": {},
      +          "type": "object"
      +        },
      +        "type": "array"
      +      }
      +    },
      +    "required": [
      +      "match",
      +      "rules"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "description": "save: the rules of a dynamic segment, checked by the database (the candidate search of merchant-candidate-list takes the same rules: try them there first)."
      +  }
      +]
    • removedOutput schema / properties / action / description
      Removed value: -"The action done."
    • removedOutput schema / properties / added / description
      Removed value: -"add_members: candidates added (members already in it are not counted)."
    • removedOutput schema / properties / created / description
      Removed value: -"save: true when a new segment was created."
    • removedOutput schema / properties / deleted / description
      Removed value: -"delete: true."
    • removedOutput schema / properties / removed / description
      Removed value: -"remove_members: candidates removed."
    • removedOutput schema / properties / segment / description
      Removed value: -"save: the segment as saved."
    • removedOutput schema / properties / segment / properties / created_at / description
      Removed value: -"Created (ISO 8601)."
    • removedOutput schema / properties / segment / properties / created_by_name / description
      Removed value: -"Who made it."
    • removedOutput schema / properties / segment / properties / description / description
      Removed value: -"Description."
    • removedOutput schema / properties / segment / properties / id / description
      Removed value: -"Segment id (profile_interview_segment.id)."
    • removedOutput schema / properties / segment / properties / kind / description
      Removed value: -"dynamic or static."
    • removedOutput schema / properties / segment / properties / name / description
      Removed value: -"Segment name."
    • changedOutput schema / properties / segment / properties / rules / allOf
      Previous value: -[
      -  {
      -    "description": "With segment_id only: the rules of a dynamic segment (static segments have none).",
      -    "properties": {
      -      "match": {
      -        "description": "all: a candidate matches every rule; any: at least one.",
      -        "enum": [
      -          "all",
      -          "any",
      -          null
      -        ],
      -        "type": [
      -          "string",
      -          "null"
      -        ]
      -      },
      -      "rules": {
      -        "description": "Up to 20 rules, each { field, op, values | value | days | from | to }, as merchant-candidate-list (rules) accepts them; for example { \"field\": \"tag\", \"op\": \"any\", \"values\": [\"<tag id>\"] }.",
      -        "items": {
      -          "additionalProperties": {},
      -          "type": "object"
      -        },
      -        "type": [
      -          "array",
      -          "null"
      -        ]
      -      }
      -    },
      -    "required": [
      -      "match",
      -      "rules"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "description": "Rules of a dynamic segment."
      -  }
      -]New value: +[
      +  {
      +    "properties": {
      +      "match": {
      +        "enum": [
      +          "all",
      +          "any",
      +          null
      +        ],
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "rules": {
      +        "items": {
      +          "additionalProperties": {},
      +          "type": "object"
      +        },
      +        "type": [
      +          "array",
      +          "null"
      +        ]
      +      }
      +    },
      +    "required": [
      +      "match",
      +      "rules"
      +    ],
      +    "type": "object"
      +  },
      +  {}
      +]
    • removedOutput schema / properties / segment / properties / updated_at / description
      Removed value: -"Last changed (ISO 8601)."
    • removedOutput schema / properties / segment_id / description
      Removed value: -"Segment id (profile_interview_segment.id)."
  4. Added

TDQS

A3.7/5.0
Behavior3/5

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

Annotations already declare destructiveHint=true, idempotentHint=false and openWorldHint=true, so the safety profile is largely covered; the description still adds real value with "Sends nothing to candidates", "Fields left out keep their value" (partial-update semantics) and "Deleting cannot be undone". It does not describe side effects on existing dynamic membership or how rule changes re-evaluate members.

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

Conciseness3/5

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

The content is front-loaded and reasonably short, but the first sentence is a tangled run-on with nested parentheses that takes effort to parse. The trailing pointer to get_tool_reference is useful but adds length without operational content.

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?

With 10 parameters, an output schema and rich annotations, the description covers the key decision points: create vs update, partial updates, irreversible deletion, static vs dynamic membership, and the equivalence of rules to the candidate search. Only minor edges (merchant scoping, kind immutability) are left to the schema, which handles them explicitly.

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 100%, so the baseline is 3, but the description adds cross-tool meaning the schema lacks: rules is the same {match, rules} shape list_candidates accepts, and may be given as an object or JSON string; candidate_ids come from list_candidates rows; name/description are preserved when omitted on a change.

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?

The description enumerates concrete actions (save/delete/add_members/remove_members) on a specific resource and explains create-vs-update via segment_id presence. It is slightly cryptic at the opening ("[Candidates] action save ...") and relies on the title to name the object as a segment, but an agent can still tell it apart from read-only siblings like list_candidates.

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 explicitly routes agents away from the wrong choice by noting list_candidates takes the same rules and shows matches without saving anything, and it separates add_members/remove_members (static segments, candidate ids) from save. It does not spell out prerequisites such as which callers may use merchant_id or when to prefer a dynamic vs static segment beyond the schema's kind note.

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.