Title100/100
Execute a SAS-language program
The title clearly communicates the tool’s action and subject. Keep it concise.
Description95/100
Execute a SAS-language program (DATA steps and PROC steps such as PROC TABULATE or PROC FREQ), optionally against a demo CDISC ADaM dataset supplied as SAS Transport (XPT). Each call is an independent run with a fresh WORK library. A dataset created by one call does not exist in the next: a program reading work.name from an earlier call fails to find it. Steps that build on each other belong in one call. On a capped tier the row limit applies to rows a DATA step WRITES as well as rows it reads. The step still runs to completion — only the first N rows it writes are kept, so a step generating 300 rows returns 100 and its later statements still execute. The cap in force is reported as limits.row_cap on every run. Returns the status, a triage summary of the SAS log (level, ERROR and WARNING lines, and a NOTE count), the printed output listing (the rendered regulator-style table, for example a demographics summary), any output datasets, a manifest of the files the run wrote as artifacts (name, mime and bytes — the file contents themselves are not returned), and, for an authenticated caller, the id of a persisted auditable artifact recording exactly what ran, including the full log, retrievable via get_execution_audit. An anonymous run is not audited and its audit_id is empty.
The description explains the capability, when to use it, and what to expect.
Inputs92/100
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
include_log
Return the run's full SAS log alongside the result. Omit (the default) and no log is returned, exactly as before; it is still retrievable afterwards via `get_execution_audit`. Set this to read the log in the SAME round trip. `log_tail_bytes` implies this.
Clear enough to supply this argument.
input_dataset
Optional input dataset to run against, given by name as a plain string. The program references it by that name, e.g. `data=adsl`. Omit for a program that needs no input. Without `org`, four synthetic CDISC-shaped ADaM demo datasets are available. They are generated together and share ONE subject list, so they join on `USUBJID`: - `adsl` — 200 rows, one per subject: USUBJID, TRT01P, SEX, RACE, AGE, AGEGR1, TRT01PN, SAFFL, ITTFL, HEIGHTBL, WEIGHTBL, BMIBL - `adae` — 216 rows, one per adverse event (safety population only): USUBJID, TRT01P, TRT01PN, AEDECOD, AEBODSYS, AESEV, AESER, AEREL, AESTDY, TRTEMFL - `adlb` — 3200 rows, one per subject/parameter/visit (BDS): USUBJID, TRT01P, TRT01PN, PARAMCD, PARAM, AVISIT, AVISITN, AVAL, BASE, CHG, ABLFL - `adtte` — 400 rows, one per subject/time-to-event parameter: USUBJID, TRT01P, TRT01PN, PARAMCD, PARAM, AVAL, CNSR, EVNTDESC Every variable is character EXCEPT these, which are numeric: AGE, TRT01PN, HEIGHTBL, WEIGHTBL, BMIBL, AESTDY, AVISITN, AVAL, BASE, CHG, CNSR. These counts are the FULL datasets. A tier-capped caller reads fewer rows — see `limits.row_cap` on the result. With `org`, this is any dataset name in that organization's shared catalog and the built-in registry is not consulted.
Clear enough to supply this argument.
log_tail_bytes
Return only the LAST this-many bytes of the log. Setting this returns the log whatever `include_log` says — including an explicit `include_log: false`, which it OVERRIDES rather than merely implying. Asking for the tail of something and getting nothing would be the more surprising reading. The tail, not the head: a run's failures land at the end. Same character-boundary rule as `max_listing_bytes`.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
max_listing_bytes
Cap the returned `listing` at this many BYTES, keeping the head. Omit for the full listing — the default is unchanged and nothing is trimmed unless you ask. Worth asking: two `PROC PRINT`s over the demo datasets already return ~27 KB, and an uncapped run over the full 3,200 -row `adlb` is several times a typical client's tool-output budget, which clients discard silently rather than reporting. The bound is honoured exactly except that it never splits a multi-byte character; when that happens the result is a byte or two shorter, and `truncated` reports what was actually returned.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
org
Optional organization slug (e.g. `"east-agile"`). When set, `input_dataset` is resolved ONLY against that organization's shared catalog (never the built-in demo registry), and the caller must be an active member of the organization. Omit to use the built-in demo registry.
Clear enough to supply this argument.
program
SAS-language program source to execute.
Clear enough to supply this argument.
Annotations50/100
Declare idempotentHint, openWorldHint based on the tool’s actual behavior.
{
"title": "Execute a SAS-language program",
"readOnlyHint": false,
"destructiveHint": false
}Output schema94/100
The output schema explains the structured result.
View output schema
{
"type": "object",
"$defs": {
"ChartSpec": {
"type": "object",
"required": [
"name",
"spec"
],
"properties": {
"name": {
"type": "string",
"description": "Sidecar filename, matching the entry in [`ExecuteResult::artifacts`] —\n`ods_output/sgplot.spec.json` beside `ods_output/sgplot.svg`."
},
"spec": {
"description": "The spec as the engine wrote it, minus any array trimming. Its schema is\nper-PROC and open; treat it as descriptive, not as a fixed contract."
},
"truncated": {
"type": "array",
"items": {
"type": "string"
},
"description": "Arrays that were shortened to bound the result, `\"<path>: <was> → <kept>\"`.\n\nNon-empty means the spec is NO LONGER a faithful reproduction input — it\nstill says what was plotted, but re-rendering it would draw a different\nfigure than the run did. Empty (and omitted) means it came through whole."
}
},
"description": "The engine's machine-readable account of one plot the run drew.\n\nA rendered figure is pixels, and this connector returns no pixels — Claude\nCode renders none, and the gateway strips artifact bytes regardless. The\nsidecar the engine writes beside every plot\n(`jenner-language/src/runtime/ods_graphics.rs`) is therefore the only way a\ncaller can check WHAT was drawn: the plot type, which column went on which\naxis, the values behind the marks."
},
"Truncated": {
"type": "object",
"required": [
"what",
"returned_bytes",
"total_bytes"
],
"properties": {
"what": {
"type": "string",
"description": "`\"listing\"` or `\"log\"`."
},
"total_bytes": {
"type": "integer",
"format": "uint",
"minimum": 0,
"description": "Bytes the run produced in full."
},
"returned_bytes": {
"type": "integer",
"format": "uint",
"minimum": 0,
"description": "Bytes actually returned — may be under the requested bound when the\ncut would have split a character."
}
},
"description": "One thing the caller's own bounds cut short.\n\nReported only when something was ACTUALLY cut. A notice that fires when\nnothing was trimmed teaches a caller to ignore it."
},
"LogSummary": {
"type": "object",
"required": [
"level",
"errors",
"warnings",
"notes"
],
"properties": {
"level": {
"type": "string"
},
"notes": {
"type": "integer",
"format": "uint",
"minimum": 0
},
"errors": {
"type": "array",
"items": {
"type": "string"
}
},
"warnings": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "A parsed triage view over a SAS-language execution log: severity level,\nthe ERROR and WARNING lines verbatim, and a count of NOTE lines."
},
"CallerLimits": {
"type": "object",
"required": [
"tier"
],
"properties": {
"tier": {
"type": "string",
"description": "The caller's EFFECTIVE tier: `anonymous` (no credential at all), `free`,\n`pro`, or `enterprise`.\n\nNot the string the caller arrived with. run-api floors everything it\ndoes not recognize — unknown, blank, legacy, even the literal\n`\"anonymous\"` — to `free` (`gateway/src/auth.rs`,\n`oauth.rs::tier_from_claim`), so an unrecognized tier is reported as the\n`free` it will actually be treated as. Echoing it back verbatim would\nname a tier that does not exist and invite planning against a cap the\ncaller does not have."
},
"row_cap": {
"type": [
"integer",
"null"
],
"format": "uint",
"minimum": 0,
"description": "Maximum observations the engine will process for this caller, or `null`\nwhen the tier runs uncapped.\n\nThe cap is TWO-SIDED: it bounds the rows a program READS *and* the rows\na DATA step WRITES. A step that generates its own data\n(`do i = 1 to 300; output; end;`) stops at this many rows, and the log\ncarries `NOTE: Unlicensed mode - output limited to N observations`. Do\nnot read this as an input-only limit — self-generated data is capped\ntoo, and that case produces no truncation notice of its own."
}
},
"description": "The execution limits the caller's TIER imposes, reported on EVERY run.\n\nAn agent that discovers its cap only after a run was truncated has already\nproduced a wrong answer over partial data. [`input_cap_for_tier`] knows the\nanswer before the run, so it is reported unconditionally — capped or not —\nand the caller can plan instead of react."
},
"DatasetPreview": {
"type": "object",
"required": [
"name",
"rows",
"columns"
],
"properties": {
"name": {
"type": "string"
},
"rows": {
"type": "integer",
"format": "uint",
"minimum": 0
},
"columns": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "One output dataset in an `execute_sas_program` result. The rendered table\nitself is in [`ExecuteResult::listing`]; this is the dataset's shape."
},
"ArtifactPreview": {
"type": "object",
"required": [
"name",
"mime",
"bytes"
],
"properties": {
"mime": {
"type": "string"
},
"name": {
"type": "string"
},
"bytes": {
"type": "integer",
"format": "uint64",
"minimum": 0
}
},
"description": "One output FILE in an `execute_sas_program` result: a plot the run\nrendered, an ODS report, a `PROC EXPORT` extract.\n\nMetadata only, and deliberately so. The engine writes these into the run's\nsandbox and names them in the log; the gateway then strips their bytes\nbefore the response reaches jenner-web\n(`clients::run_api::OutputFile`). Reporting the manifest is what stops a\nrun that produced a figure from looking like a run that produced nothing —\nfetching the bytes is a separate concern with its own authorization."
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"required": [
"ok"
],
"properties": {
"ok": {
"type": "boolean",
"description": "`true` = the program ran; `false` = the caller's input was rejected."
},
"log": {
"type": [
"string",
"null"
],
"description": "The run's SAS log, present only when the caller asked for it via\n`include_log` or `log_tail_bytes`. Absent by default, exactly as before."
},
"error": {
"type": [
"string",
"null"
],
"description": "Present iff `ok:false`. The rejection reason; generic and slug-free for\nthe org-access cases (see [`ORG_REFUSAL`])."
},
"limits": {
"anyOf": [
{
"$ref": "#/$defs/CallerLimits"
},
{
"type": "null"
}
],
"description": "The execution limits the caller's tier imposes. Present on every run,\ncapped or not, so an agent can plan before it is truncated rather than\ndiscover the bound afterwards."
},
"status": {
"type": [
"string",
"null"
],
"description": "The engine's raw status string (e.g. `\"ok\"`, `\"completed\"`) — kept for\nprovenance, but NOT authoritative: the engine can report `ok` on a\nfailed step. Trust `log_summary.level` for the real outcome."
},
"listing": {
"type": [
"string",
"null"
],
"description": "Printed output — the regulator-style table lives here."
},
"audit_id": {
"type": [
"string",
"null"
],
"description": "Id of the persisted auditable artifact; pass to `get_execution_audit`."
},
"datasets": {
"type": [
"array",
"null"
],
"items": {
"$ref": "#/$defs/DatasetPreview"
},
"description": "Output dataset previews. `Some([])` on a run that produced none —\n`Option`, not a bare `Vec` skipped when empty, so \"the run made no\ndatasets\" stays distinguishable from \"there was no run\"."
},
"artifacts": {
"type": [
"array",
"null"
],
"items": {
"$ref": "#/$defs/ArtifactPreview"
},
"description": "Files the run wrote. `Some([])` on a run that produced none — an\n`Option`, not a bare `Vec` skipped when empty, so \"the run made no\nfiles\" stays distinguishable from \"there was no run\", exactly as\n`datasets` does."
},
"truncated": {
"type": "array",
"items": {
"$ref": "#/$defs/Truncated"
},
"description": "What the caller's own bounds cut short. Empty (and omitted) when the\ncaller set no bounds, or when nothing exceeded them."
},
"chart_specs": {
"type": [
"array",
"null"
],
"items": {
"$ref": "#/$defs/ChartSpec"
},
"description": "Structured descriptions of the plots the run drew, one per sidecar the\nengine wrote. `Some([])` on a run that drew nothing — and also on a run\nwhose sidecars could not be read back, which is deliberately not an\nerror: `artifacts` still names every file, so a caller can always tell a\nfigure was produced."
},
"duration_ms": {
"type": [
"integer",
"null"
],
"format": "uint64",
"minimum": 0
},
"log_summary": {
"anyOf": [
{
"$ref": "#/$defs/LogSummary"
},
{
"type": "null"
}
],
"description": "Triage view over the SAS log: the authoritative `level` (reconciled\nwith the engine exit code), ERROR/WARNING lines, and NOTE count.\nThe full log is not returned inline BY DEFAULT (every tool return\ncrosses the caller's context window on each subsequent turn). Ask for it\nwith `include_log` or `log_tail_bytes` in the same round trip; it is also\npersisted in full on the audit and retrievable via\n`get_execution_audit`."
},
"input_notice": {
"type": [
"string",
"null"
],
"description": "Platform notice that the caller's TIER capped the program's input, so\nthe result covers only the first N rows. Distinct from\n`log_summary.warnings`, which is SAS-engine log content: this is\njenner-web speaking about the plan the caller is on. `null` when nothing\nwas capped. Always serialized (part of the ok:true schema contract);\n`None` on a reject."
}
}
}