Skip to main content
Glama
sassoftware

SAS MCP Server

Official
by sassoftware

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
VIYA_ENDPOINTYesThe URL of your SAS Viya server

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": true
}
logging
{}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
extensions
{
  "io.modelcontextprotocol/ui": {}
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
execute_sas_codeA

Executes the provided SAS code in the Viya environment and returns information about the completed Job. This will create a job definition for the SAS code, execute it, and then retrieve the results.

The code runs in a reusable compute session that is kept warm and shared across calls (per user), so SAS state — WORK tables, macro variables, and assigned librefs — persists between successive execute_sas_code calls. Call reset_compute_session to discard that state and start fresh.

list_cas_serversA

List available CAS servers on the Viya environment.

list_caslibsB

List CAS libraries (caslibs) available on a CAS server.

list_castablesB

List tables in a CAS library.

list_source_tablesA

List source tables that are NOT yet loaded into memory in a CAS library.

These are the candidates for promote_table_to_memory — tables that exist on the caslib's data source but are not in CAS memory yet.

get_castable_infoA

Get metadata for a CAS table (row count, column count, size, etc.).

get_castable_columnsB

Get column metadata for a CAS table (names, types, labels, formats).

get_castable_dataB

Fetch rows from a CAS table with column names.

upload_dataA

Upload a data file into a CAS table — read by the server, not the model.

Provide the data by reference through exactly one of:

  • file_path — the server reads the file off its own disk (in stdio mode that's your machine). Disable with ALLOW_LOCAL_FILE_UPLOAD=false.

  • url — the server fetches it over HTTP.

Either way the bytes are read server-side and never pass through the calling model's context window. To create a small table you are building inline (no file or URL), use the upload_inline_data tool instead.

The casManagement uploadTable endpoint only accepts an uploaded file (multipart form-data) and has no URL parameter, so url is fetched and sent on as the multipart file part.

Formats. Per the uploadTable API: csv, xls, xlsx (single sheet), sas7bdat, sashdat; tsv is csv with a tab delimiter. parquet is not accepted and is rejected up front with guidance (load via a path-based caslib + promote_table_to_memory, or convert to csv/sas7bdat). The format is auto-detected from the file_path/url extension; pass data_format to override (needed for URLs with no clean suffix).

upload_inline_dataA

Create a small CAS table from inline delimited text passed as a string.

Use this only for tiny, hand-built tables — a lookup/mapping table the model constructs on the fly, or a quick test table — because the whole payload travels through the model's context as a tool argument. For anything larger, or any file you already have, use upload_data (file_path/url), which reads the bytes server-side instead.

Text formats only: csv (default) or tsv (tab-separated). For binary formats (Excel, sas7bdat, sashdat) use upload_data.

promote_table_to_memoryA

Load a source table into CAS memory at global scope (visible to all sessions).

Loads the table from its caslib data source and promotes it to global scope via the casManagement updateTableState API. Idempotent: if the table is already loaded in global scope it is left untouched. Use list_source_tables to discover unloaded tables that can be promoted.

list_filesB

List files in the Viya Files Service.

upload_fileB

Upload a file to the Viya Files Service.

download_fileB

Download file content from the Viya Files Service.

list_reportsB

List Visual Analytics reports.

get_reportA

Get a Visual Analytics report's metadata and definition.

export_reportA

Export a Visual Analytics report (or specific report objects) in any format the VA service exposes, via its synchronous export endpoints.

Formats (export_format):

  • package — full report bundle as a .zip (source files, query results, and rendered content); whole report or selected objects.

  • pdf — rendered PDF; whole report or selected objects. Pass rendering overrides (e.g. orientation, paperSize, margin, includeCoverPage) via options.

  • png / svg — image of the report or a single object; image_size is required, e.g. "1200px,800px".

  • csv / tsv / xlsx — the data behind a single report object; exactly one object label is required.

  • summary — the report's text summary.

submit_batch_jobB

Submit a SAS job for asynchronous execution via the Job Execution service.

get_job_statusB

Check the status of a submitted job.

list_jobsC

List recent jobs from the Job Execution service.

cancel_jobB

Cancel a running job.

get_job_logB

Retrieve the log of a completed job.

list_ml_projectsC

List AutoML pipeline automation projects.

create_ml_projectA

Create a new AutoML pipeline automation project from a CAS table.

The training table must already be loaded into CAS memory at global scope. This tool verifies that first and returns an actionable error otherwise (use promote_table_to_memory to load + promote a source table, and list_source_tables to find one). The data-table URI is built from server_id/caslib_name/table_name.

list_publishing_destinationsB

List available publishing destinations.

register_ml_champion_modelB

Register the champion model from an AutoML pipeline automation project to the Model Repository.

publish_ml_champion_modelB

Publish the champion model from an AutoML pipeline automation project to the Model Repository.

run_ml_projectC

Run an AutoML pipeline automation project.

list_registered_modelsB

List models in the Model Repository.

list_models_and_decisionsC

List published scoring models and decisions (MAS modules).

score_dataB

Score data against a published model or decision (MAS module).

create_business_rulesetA

Create a new SAS Business Rules rule set.

A rule set with no rules cannot be used in a decision flow — follow up with create_business_rule to populate it.

update_business_rulesetA

Update an existing SAS Business Rules rule set's name/description/signature.

Changing the signature can invalidate existing rules that reference removed variables — check with get_business_ruleset first if unsure.

get_business_rulesetB

Fetch a single SAS Business Rules rule set by ID.

list_business_rulesetsA

List SAS Business Rules rule sets, optionally filtered by name substring.

delete_business_rulesetA

Permanently delete a SAS Business Rules rule set.

Only call this once the rule set is confirmed unused by any decision flow — deleting a rule set still referenced by a decision fails.

lock_business_ruleset_revisionA

Lock the current state of a rule set as an immutable revision.

Decision steps reference a specific rule set revision (versionId), not the live working copy, so a revision must exist before wiring a rule set into a decision flow — call again after editing rules if a decision needs to pick up the changes.

The revision-creation request replaces the rule set's full content from the body sent, so this fetches the rule set with its rules included (application/vnd.sas.business.rule.set.integral+json) and resends them — omitting them would wipe the live rule set's rules, not just the new revision.

list_business_ruleset_revisionsB

List all locked revisions of a rule set.

create_business_ruleA

Create a new rule inside an existing SAS Business Rules rule set.

A rule set can hold multiple rules, each evaluated per its conditional type. Condition/action expressions must include the variable name directly (e.g. "credit_score < 650", not just "< 650") — the API accepts the latter as valid but generates DS2 code with a missing left-hand operand. Boolean signature variables must be compared with = 0/= 1 in expressions, not = false/= true.

update_business_ruleB

Update an existing rule inside a SAS Business Rules rule set.

get_business_ruleA

Fetch a single rule's definition from a SAS Business Rules rule set.

list_business_rulesB

List all rules inside a SAS Business Rules rule set.

delete_business_ruleB

Permanently delete a rule from a SAS Business Rules rule set.

create_decision_flowB

Create a new SAS Intelligent Decisioning flow chaining rule set steps.

update_decision_flowA

Update an existing SAS Intelligent Decisioning flow.

Pass ALL rule set steps (existing + new) — the full flow is replaced on update, it is not a partial patch.

get_decision_flowB

Fetch the current state of a SAS Intelligent Decisioning flow.

list_decision_flowsC

List SAS Intelligent Decisioning flows, optionally filtered by name substring.

delete_decision_flowB

Permanently delete a SAS Intelligent Decisioning flow.

get_decision_flow_codeB

Retrieve the generated DS2 execution code for a decision flow.

lock_decision_flow_revisionA

Lock the current state of a decision flow as an immutable revision.

Call after a successful create/update to freeze the approved state as a point-in-time snapshot referenceable by publish_decision_flow.

list_decision_flow_revisionsB

List all locked revisions of a decision flow.

get_decision_flow_revisionA

Fetch the content of a specific locked decision revision.

publish_decision_flowA

Publish a locked decision revision to a Micro Analytic Score (MAS) destination.

Required before score_data can execute the decision — MAS runs published modules, not decision flows directly. Requires the DS2 code generation service to be healthy for this decision's rule sets; an error mentioning rule set code generation is an environment-level issue, not a bad payload.

Publishing is asynchronous and the resulting MAS module ID is server-generated — it is NOT publish_name. This polls the publish job (properties.masModules[0].jobUri) until it reaches a terminal state and returns the real moduleId alongside the publish record, so the result is directly usable with get_mas_module_step_signature/score_data without a separate lookup via list_models_and_decisions.

get_mas_module_step_signatureA

Fetch a MAS module step's input/output variable signature.

Call before score_data to know the exact variable names, types, and order to pass as inputs, and what outputs to expect.

list_compute_contextsB

List available compute contexts on the Viya environment.

list_compute_librariesA

List the SAS libraries (librefs) assigned in a compute context.

Runs in the reusable per-user compute session for the context, so it also sees libraries created by prior execute_sas_code calls.

list_compute_tablesA

List the tables in a SAS library within a compute context.

These are SAS/Compute tables (e.g. WORK or an assigned libref), distinct from in-memory CAS tables (see list_castables). Runs in the reusable per-user compute session for the context.

list_compute_columnsA

List the columns of a table in a SAS library within a compute context.

Runs in the reusable per-user compute session for the context.

reset_compute_sessionA

Reset (delete) the cached compute session for a compute context.

The server keeps one reusable SAS compute session per user and compute context so repeat calls skip the slow session spin-up; SAS state (WORK tables, macro variables, assigned librefs) therefore persists across execute_sas_code and list_compute_* calls. Call this to discard that state — the next compute tool call transparently creates a fresh session.

catalog_searchA

Search the SAS Information Catalog for assets (tables, columns, reports, ...).

The catalog is a metadata index across the whole Viya environment, so this finds assets without needing to know their server/library first. Each hit includes the asset's resource_uri — the URI you can hand to the matching tool (e.g. get_report, get_castable_data) to act on the live asset — and an attributes map with whatever metadata the catalog holds for it (commonly library, rowCount, columnCount, completenessPercent, reviewStatus, informationPrivacy, and analysisTimeStamp).

The query uses the SAS catalog search grammar:

  • Free text matches names, with wildcards * (0+ chars) and ? (1 char): cust*.

  • Facets constrain fields, e.g. AssetType:Report, Name:sales, Library.name:PUBLIC, Column.informationPrivacy:Sensitive.

  • Ranges DateModified:[2024-01-01 TO 2024-12-31] and + to require a term. Combine freely: AssetType:"CAS Table" +Name:cust*. Use catalog_search_helper to discover valid facet names and values.

catalog_search_helperA

Discover how to search the catalog: list facets, or values for one facet.

Call with no facet to list the available facets — the fields you can constrain in a catalog_search query. Call with a facet name to get the suggested/valid values for that facet (e.g. the asset types or review statuses that actually exist). Use the results to build precise catalog_search queries.

catalog_find_instanceA

Resolve the catalog instance for a source-asset URI.

catalog_search finds assets by free text and facets, but the profiling and download tools key off a catalog instance id. When you already hold a resource URI — the resource_uri from a search hit, or a CAS table path — this looks the instance up directly by resourceId (the same filter the profiling workflow uses) and returns its id plus the key profile attributes. Use it to tell at a glance whether the asset has been profiled (analysisTimeStamp) and what semantic metadata it carries (informationPrivacy, nlpTerms, nlpTags, mostImportantFields) before calling catalog_download_table_profile.

catalog_list_agentsA

List SAS Information Catalog discovery agents.

Agents crawl a data source (server/library) to discover assets and collect their metadata into the catalog. Use catalog_run_agent to start one and catalog_get_agent_history to see what a run produced.

catalog_run_agentA

Start a catalog discovery agent run (asynchronous).

Triggers the agent to crawl its data source and populate/refresh catalog metadata. The run is asynchronous — results are applied to the catalog in the background; poll catalog_get_agent_history to track completion. Note: the Catalog API can only start an agent, not stop one already running.

catalog_get_agent_historyA

Get the execution history of a catalog agent's runs.

Each record reports a run's status and how much metadata it populated (tables enumerated/added/updated/removed), so you can confirm a run started by catalog_run_agent finished and what it changed.

catalog_run_adhoc_analysisA

Submit an ad-hoc analysis (profiling) job for a table in the catalog.

Profiles the table — computing the data dictionary, column statistics, and data-quality metrics that catalog_download_table_profile returns. The job runs asynchronously and may take a while; poll catalog_get_adhoc_analysis with the returned job id until the profile is ready.

The three NLP job parameters are enabled by default — they drive the semantic enrichment that populates an asset's informationPrivacy, nlpTerms, nlpTags, and mostImportantFields (the privacy and keyword signals the catalog is most useful for). Leave them on unless you only need a plain column profile and want the job to finish faster.

catalog_get_adhoc_analysisA

Get the status of an ad-hoc analysis job, and whether its profile is ready.

The job reaching a terminal status is not sufficient: the profile attributes are written onto the asset a little later, so a download fired the instant the job completes can come back empty. To close that gap, when the job carries a resource this also resolves the target catalog instance and reports profile_ready (the asset's analysisTimeStamp is populated — the same gate catalog_download_table_profile uses) and information_privacy (non-empty once the NLP semantic enrichment has landed). Poll until profile_ready is true, then download.

catalog_download_table_profileA

Download a catalog table's data dictionary and profile as CSV.

Returns the table's column metadata plus, by default, its profile (column statistics and data-quality metrics). If the table has not been profiled yet, this returns a recommendation to run catalog_run_adhoc_analysis (pre-filled with the table's URI and type) instead of an empty profile.

Identify the table by either instance_id or resource_uri (give one). Passing resource_uri lets you run search → profile → download without ever handling an instance id: the asset is resolved by resourceId the same way catalog_find_instance does. instance_id takes precedence if both are given.

Prompts

Interactive templates invoked by user choice

NameDescription
debug_sas_logAnalyze a SAS log for errors, warnings, and notes with root-cause explanations and suggested fixes.
explore_datasetGenerate comprehensive SAS data-profiling code (CONTENTS, MEANS, FREQ, UNIVARIATE).
data_quality_checkGenerate SAS code for a data quality assessment (completeness, uniqueness, validity).
statistical_analysisSet up a complete SAS statistical analysis workflow with diagnostics.
optimize_sas_codeReview and optimize SAS code for performance, readability, or both.
explain_sas_codeProvide a block-by-block explanation of SAS code, tailored to skill level.
sas_macro_builderBuild a production-quality reusable SAS macro.
generate_reportGenerate SAS ODS/PROC REPORT code for formatted output.

Resources

Contextual data attached and managed by the client

NameDescription

No resources

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/sassoftware/sas-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server