Skip to main content
Glama

nevent_create_segment

Create and persist a new audience segment from a filter definition. SEMANTICS: criteria in the same stanza are OR-combined — a fan matches the stanza if ANY criterion matches. Stanzas are AND-combined — a fan must match EVERY stanza. To require A AND B, put them in separate stanzas; to accept A OR B, put both in the same stanza. PREREQUISITE: call nevent_segmentation_criteria first to discover valid criterion_ids and operators. MANDATORY RULES: (1) ENTITY operators (is/is_not) accept a single string OR an array of strings — e.g. value: "EVENT_ID" or value: ["E1","E2"]. (2) Omit modifiers unless the user explicitly requests frequency/recency filtering; if included, time_range.value MUST be > 0. (3) Criteria fields: only criterion_id, operator, value — omit id, timeframe, type. (4) KNOWN LIMITATION: do NOT mix attendance criteria (attended_event, ticket_type) with spending criteria (total_spent, ticket_spent, cashless_recharge_amount) in the same stanza — put them in separate stanzas. Separate stanzas are AND-combined, so a fan must match both. After creation, call nevent_segment_preview to count the audience, then nevent_create_campaign to send to this segment.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesHuman-readable name for the segment, e.g. "VIP Attendees 2025"
definitionYesSegment DSL. Criteria in the same stanza are OR-combined: a fan matches the stanza if ANY criterion matches. Stanzas are AND-combined: a fan must match EVERY stanza. To require A AND B, put them in separate stanzas; to accept A OR B, put both in the same stanza. Must have at least one stanza with at least one criterion. Use nevent_segment_preview first to validate the definition.
descriptionNoOptional description of the segment's purpose

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / definition / properties / stanzas / items / properties / criteria / items / properties / modifiers / description
      Previous value: -"ADVANCED: Usually OMIT this field entirely. Only include when the user explicitly asks for:\n- \"at least X times\" → { frequency: { count: X, operator: \"gte\" } }\n- \"in the last X days\" → { time_range: { value: X, unit: \"day\" } } (value MUST be > 0)\nIf not asked for frequency or recency, DO NOT include modifiers."New value: +"ADVANCED: Usually OMIT this field entirely. Only include when the user explicitly asks for:\n- \"at least X times\" → { frequency: { count: X, operator: \"gte\" } }\n- \"in the last X days\" → { time_range: { value: X, unit: \"days\" } } (value MUST be > 0; unit is one of days, weeks, months, years)\nIf not asked for frequency or recency, DO NOT include modifiers."
  2. Changed3 schema fields changed
    • changedInput schema / properties / definition / description
      Previous value: -"Segment DSL: stanzas are OR-combined, criteria within each stanza are AND-combined. Must have at least one stanza with at least one criterion. Use nevent_segment_preview first to validate the definition."New value: +"Segment DSL. Criteria in the same stanza are OR-combined: a fan matches the stanza if ANY criterion matches. Stanzas are AND-combined: a fan must match EVERY stanza. To require A AND B, put them in separate stanzas; to accept A OR B, put both in the same stanza. Must have at least one stanza with at least one criterion. Use nevent_segment_preview first to validate the definition."
    • changedInput schema / properties / definition / properties / stanzas / description
      Previous value: -"Array of stanzas (OR logic). Each stanza contains criteria (AND logic)."New value: +"Array of stanzas. Stanzas are AND-combined: a fan must match EVERY stanza. Criteria inside one stanza are OR-combined, so a fan matching ANY of them matches that stanza."
    • changedInput schema / properties / definition / properties / stanzas / items / properties / criteria / description
      Previous value: -"Criteria combined with AND logic within this stanza."New value: +"Criteria in the same stanza are OR-combined: a fan matches the stanza if ANY criterion matches. Stanzas are AND-combined, so a fan must match EVERY stanza."
  3. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Annotations only indicate readOnlyHint=false and destructiveHint=false. The description adds substantial behavioral context: the OR/AND combination semantics, mandatory rules for operators and modifiers, the known limitation about mixing criteria types, and the exact field constraints. It clearly communicates that this is a mutating operation and how it behaves, far beyond what annotations provide.

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?

The description is long but well-structured: it starts with the purpose, then SEMANTICS, PREREQUISITE, and MANDATORY RULES in bold labels. Every sentence carries unique information; there is only minor repetition of the OR/AND concept that also appears in the schema. The front-loading of the purpose and key rules aids an agent scanning for essentials.

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 tool with no output schema, the description compensates by explaining the intended follow-up calls (preview, campaign). It covers the complex DSL, mandatory rules, and limitations thoroughly. It does not describe the response format (e.g., segment ID), but that is minor given the tool's creation purpose and the rich sibling context.

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 description coverage is 100%, so the schema already documents parameters thoroughly. The description adds value by clarifying the OR/AND combination logic (repeated but reinforced), the 'omit modifiers' guidance, and the rule against mixing attendance with spending criteria. These are not fully explicit in the schema and help avoid common mistakes.

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 states a clear verb ('Create and persist') and resource ('a new audience segment from a filter definition'). It is distinguishable from siblings like nevent_update_segment and nevent_segment_preview by emphasizing creation and persistence. The systematic rules and prerequisites further differentiate it.

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?

The description provides a direct prerequisite ('call nevent_segmentation_criteria first'), a recommended post-creation flow ('call nevent_segment_preview... then nevent_create_campaign'), and explicit rules about when to include modifiers. It does not explicitly contrast with update/execute, but the creation vs. update distinction is implicit.

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.