Skip to main content
Glama
sassoftware

SAS MCP Server

Official
by sassoftware

execute_sas_code

Executes SAS code in the Viya environment and returns job results, with persistent state across calls for reusing WORK tables, macro variables, and librefs.

Instructions

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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sas_codeYesthe SAS code snippet to be executed using the Viya Job Execution API Service

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

With no annotations provided, the description carries full burden. It discloses that code runs in a reusable compute session, state persists across calls (WORK tables, macro variables, librefs), and that it creates a job definition, executes it, and retrieves results. This is thorough and goes beyond the input schema.

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

Conciseness5/5

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

The description is extremely concise: 4 sentences covering purpose, state persistence, and a reference to a sibling tool. Every sentence adds value, no redundancy, and it is front-loaded with the main action.

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?

Given the complexity (stateful execution, job lifecycle) and the presence of an output schema, the description adequately covers the return value as 'information about the completed Job'. It does not mention related tools like get_job_log or get_job_status for further details, but the tool itself returns job information, so it may be sufficient. A minor gap, but overall complete.

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

Parameters3/5

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

Schema coverage is 100%, so the input schema already describes the parameter 'sas_code' as a string. The description does not add new semantics about the parameter itself, but it provides context on how the code is executed. Baseline 3 is appropriate as the schema does the heavy lifting.

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 clearly states it executes SAS code and returns job information. It also mentions state persistence, which distinguishes it from other tools like reset_compute_session. The verb 'executes' and resource 'SAS code' are specific, and it differentiates from siblings by noting the reusable compute session.

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 explains when to use the tool (for executing SAS code) and explicitly mentions that if you need to discard persistent state, you should use reset_compute_session. However, it does not explicitly state when not to use it or mention other alternative tools like submit_batch_job for batch jobs. Clear enough but could be more comprehensive.

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

Install Server

Other Tools

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