get_castable_data
Fetch sample rows from a CAS table
How to use it
get_castable_data is exposed by the Sas MCP Server MCP server. Add the server to your MCP client (Claude Desktop, Cursor, Windsurf and others), and the get_castable_data tool becomes available to the model automatically. See the full listing for setup details and every tool this server provides.
Install Sas MCP Server
docker run -e VIYA_ENDPOINT=https://your-viya-server.com -p 8134:8134 ghcr.io/sassoftware/sas-mcp-server:latestOther tools in Sas MCP Server (39)
The authoring workhorse — apply an ordered batch of native VA operations (addData, addPage, addObject, updateObject, setParameterValue, updateData, changeData, applyDataView) to a report. Give a page a title with addPage's title field (a text band at the top of the page body — VA headers are control
Download a table's data dictionary and column profile as CSV, identified by either instanceid or resourceuri.
Resolve the catalog instance for a source-asset resourceuri, bridging a search hit to the profiling and download tools without handling an instance id by hand.
Poll a profiling job and cross-check the target instance, reporting profileready once results have landed on the asset — so a download isn't fired too early.
Inspect an agent's run history — status and how much metadata each run enumerated/added/updated/removed.
List the catalog's discovery agents (the crawlers that populate metadata).
Submit an ad-hoc profiling job for a table. NLP enrichment (language, sentiment, semantic IDs) is on by default, populating informationPrivacy, nlpTerms, nlpTags, and mostImportantFields.
Start a discovery agent run (asynchronous) to crawl its data source and refresh catalog metadata.
Search the catalog for assets (tables, columns, reports, …) using the SAS catalog search grammar (free text, facets like AssetType:Report, ranges). Each hit carries a resourceuri you can hand to the matching tool (e.g. getreport, getcastabledata).
Discover how to query the catalog — list the available facets, or the valid values for one facet — so you can build precise catalogsearch queries.
Copy a report to a new one (optionally renaming/refoldering). Pairs with a changeData operation for the copy-and-replace pattern.
Create a Visual Analytics report and return its id. Optionally pass an operations array to build the whole report in one atomic call; the result carries the created page/object names+labels and a verify hint.
Delete a report and its content.
Discover what a report can contain — the eight report operations and every addable object (bar chart, list table, geo map, key value, …) with a one-line purpose, its data roles, common options, and an example payload. Call with no arguments for the catalog (including an intent→object map, placement
Download file content
Execute SAS code snippets and retrieve execution results (log and listing output). Runs in a reusable, per-user compute session that is kept warm across calls, so SAS state (WORK tables, macro variables, assigned librefs) persists between successive calls — use resetcomputesession to start fresh.
export a report (or specific report objects) in any format the VA service supports — package (zip), pdf, png, svg, csv, tsv, xlsx, or summary. Text formats come back inline, png as image content, and binary formats (package/pdf/xlsx) as an embedded file with the right MIME type.
Get column names, types, labels, formats
Get table metadata (row count, columns, size)
Check job state
Get report metadata and definition
Read a report's structure back — pages → objects with the handles the other tools need (object name for placement/updateObject targets, label for exportreport, page label for page placement).
List available CAS servers
List CAS libraries on a server
List tables in a CAS library
List the columns of a table in a SAS library
List available compute contexts
List the SAS libraries (librefs) assigned in a compute context
List the tables in a SAS library within a compute context
List files in the Viya Files Service
List Visual Analytics reports
List source tables not yet loaded into memory (candidates for promotion)
Load a source table into memory at global scope (idempotent)
Run a FedSQL SELECT against CAS or compute data and get the rows back — one SQL surface over both storage tiers. Pick the tier with target (cas for caslib.table, compute for libref.table); joins, subqueries, aggregation, and UNION all work, and the row cap is applied server-side by the tool (a LIMIT
Delete the cached compute session for a context, discarding its SAS state and forcing a fresh session on the next call
Submit a SAS job for async execution
Upload a data file into a CAS table — read server-side so the data never passes through the model's context — from filepath (the server reads it off disk) or url (the server fetches it and converts it to the multipart upload the endpoint requires). Ingests the formats the casManagement uploadTable A
Upload a file to the Viya Files Service, optionally into a Content folder (parentfolderuri). Content comes from exactly one of content (inline text), filepath (read server-side, binary-safe — xlsx, zip, images — gated by ALLOWLOCALFILEUPLOAD), or url (server-side fetch)
Create a small CAS table from inline csv/tsv text passed as a string (a lookup/mapping table the model builds on the fly, or a quick test table). The payload travels through the model's context, so it's for tiny tables only — use uploaddata for files or anything larger.