Skip to main content
Glama
sassoftware

SAS MCP Server

Official
by sassoftware

Create Segmentation Tree

create_segmentation_tree

Create a SAS Intelligent Decisioning segmentation tree by defining variable tests, ordered value nodes, and outcomes to route cases and assign decision values.

Instructions

Create a SAS Intelligent Decisioning segmentation tree.

A node tests one variable; its valueNodes are checked in order and the first match wins, then goes to next (another node) or to an outcomeName. A value is a value, several separated by ; ("A;B"), a comparison (">=630"), a range with v ("600<=v<630"), or "Other" for everything else, missing values included. Example::

node = {"variable": "score", "valueNodes": [
    {"value": ">=630", "outcome": "low_risk"},
    {"value": "Other", "outcome": "high_risk"}]}
outcomes = [{"name": "low_risk", "assign": {"band": "LOW"}},
            {"name": "high_risk", "assign": {"band": "HIGH"}}]

An outcome assigns with assign (variable to value) or runs DS2 statements with code. To build a large tree from a strategy table, use create_segmentation_tree_from_table.

Input Schema

NameRequiredDescriptionDefault
nameYesTree name.
nodeYesThe root node.
folderNoWhere to store the tree: a folder path, ``My Folder``, a folder ID or URI. Omit to use the default folder; if there is none, ask the user.
matricesNoMatrix definitions, for nodes of type matrix.
outcomesNoThe outcomes the value nodes lead to.
signatureYesEvery variable the tree tests or assigns, each ``{"name", "dataType", "direction"}`` — dataType string, decimal, integer, date, datetime or boolean; direction input, output or inOut. Add ``valueListId`` / ``valueListContentId`` to tie a variable to a value list.
code_filesNoInternal code files ``{"name", "type": "internal", "code"}``.
descriptionNoOptional description.
boolean_expressionsNoNamed DS2 conditions, ``{"name", "expression"}``, for nodes of type booleanExpression (value nodes "true" / "false").

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.19.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare this is a non-read-only, non-destructive, non-idempotent create. The description adds real behavioral substance: how nodes evaluate (first match wins, then ``next`` or ``outcomeName``), how values are parsed, and that outcomes either assign or run DS2 code. It doesn't state what happens on name collisions or failure modes, keeping it at 4.

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, then structural semantics, then a compact example, then the sibling routing — a sensible order. The value-syntax sentence and example are dense but earn their space; a little of the prose could be trimmed without loss.

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 9-parameter create with nested objects, the description covers the hardest parts (node tree traversal, value syntax, outcomes, folder default behavior). Secondary params like matrices, code_files, and boolean_expressions rely on their schema descriptions, and an output schema exists, so the residual gap is small.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, but the critical nested objects (`node`, `outcomes`, `matrices`) are only `additionalProperties: true` in the schema — the description supplies the actual shape, value mini-language, and a concrete worked example. That is meaningfully beyond what the schema conveys.

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?

Opens with a specific verb+resource: "Create a SAS Intelligent Decisioning segmentation tree." That immediately distinguishes it from update_segmentation_tree and from create_segmentation_tree_from_table, which is named later as the alternative.

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?

Explicitly routes large, table-driven trees to create_segmentation_tree_from_table, which is the key selection decision an agent faces here. It stops short of full when/when-not guidance (e.g. no mention of prerequisites, permissions, or duplicate-name behavior), so 4 rather than 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools