@sassoftware/sas-score-mcp-serverjs 0.4.1-7 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.skills/agents/sas-viya-scoring-expert.md +58 -0
- package/.skills/copilot-instructions.md +147 -0
- package/.skills/skills/sas-find-library-smart/SKILL.md +154 -0
- package/.skills/skills/sas-list-tables-smart/SKILL.md +127 -0
- package/.skills/skills/sas-read-and-score/SKILL.md +111 -0
- package/{skills → .skills/skills}/sas-read-strategy/SKILL.md +43 -30
- package/.skills/skills/sas-request-classifier/SKILL.md +69 -0
- package/{skills → .skills/skills}/sas-score-workflow/SKILL.md +49 -35
- package/cli.js +222 -140
- package/package.json +5 -4
- package/scripts/docs/SCORE_SKILL_REFERENCE.md +142 -0
- package/scripts/docs/TOOL_DESCRIPTION_TEMPLATE.md +157 -0
- package/scripts/docs/TOOL_UPDATES_SUMMARY.md +208 -0
- package/scripts/docs/mcp-localhost-config-guide.md +184 -0
- package/scripts/docs/oauth-http-transport.md +96 -0
- package/scripts/docs/sas-mcp-tools-reference.md +600 -0
- package/scripts/getViyaca.sh +1 -0
- package/scripts/optimize_final.py +140 -0
- package/scripts/optimize_tools.py +99 -0
- package/scripts/setup-skills.js +34 -0
- package/scripts/update_descriptions.py +46 -0
- package/scripts/viyatls.sh +3 -0
- package/src/authpkce.js +219 -220
- package/src/createMcpServer.js +10 -5
- package/src/expressMcpServer.js +54 -186
- package/src/oauthHandlers/authorize.js +46 -0
- package/src/oauthHandlers/baseUrl.js +8 -0
- package/src/oauthHandlers/callback.js +96 -0
- package/src/oauthHandlers/getMetadata.js +27 -0
- package/src/oauthHandlers/index.js +7 -0
- package/src/oauthHandlers/token.js +37 -0
- package/src/processHeaders.js +88 -0
- package/src/setupSkills.js +37 -0
- package/src/toolHelpers/_listLibrary.js +0 -1
- package/src/toolHelpers/getLogonPayload.js +5 -1
- package/src/toolHelpers/refreshToken.js +3 -2
- package/src/toolHelpers/refreshTokenOauth.js +3 -3
- package/src/toolSet/.claude/settings.local.json +2 -1
- package/src/toolSet/findModel.js +1 -1
- package/src/toolSet/findTable.js +3 -3
- package/src/toolSet/modelScore.js +2 -2
- package/src/toolSet/runJob.js +81 -81
- package/src/toolSet/runJobdef.js +82 -82
- package/skills/mcp-tool-description-optimizer/SKILL.md +0 -129
- package/skills/mcp-tool-description-optimizer/references/examples.md +0 -123
- package/skills/sas-read-and-score/SKILL.md +0 -91
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: sas-read-strategy
|
|
3
3
|
description: >
|
|
4
|
-
Guide the user in choosing the right data retrieval tool: read-table (for raw row access with filters)
|
|
5
|
-
or sas-query (for analytical queries, aggregations, joins). Use this skill when the user wants to
|
|
4
|
+
Guide the user in choosing the right data retrieval tool: sas-score-read-table (for raw row access with filters)
|
|
5
|
+
or sas-score-sas-query (for analytical queries, aggregations, joins). Use this skill when the user wants to
|
|
6
6
|
fetch records from a SAS/CAS table. Trigger phrases include: "read records from", "get data where",
|
|
7
7
|
"fetch rows from", "query the table", "give me the first N records", "aggregate by", "join tables",
|
|
8
8
|
or any request that starts with data retrieval.
|
|
@@ -10,21 +10,25 @@ description: >
|
|
|
10
10
|
|
|
11
11
|
# SAS Read Strategy
|
|
12
12
|
|
|
13
|
-
Guides the decision between `read-table` and `sas-query` based on the user's intent and the nature
|
|
14
|
-
of the data operation.
|
|
15
|
-
|
|
16
|
-
---
|
|
13
|
+
Guides the decision between `sas-score-read-table` and `sas-score-sas-query` based on the user's intent and the nature
|
|
14
|
+
of the data operation. Determines which server contains the data and which retrieval tool is most appropriate.
|
|
17
15
|
|
|
18
16
|
## Determine the server location
|
|
19
17
|
|
|
20
|
-
Before retrieving data,
|
|
18
|
+
Before retrieving data, verify the library and determine which server(s) contain the table:
|
|
21
19
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
20
|
+
**Step 1: Verify library existence**
|
|
21
|
+
- Use `sas-find-library-smart` skill to check the library in CAS first, then SAS if needed
|
|
22
|
+
- This establishes the correct server and uppercase convention for SAS libraries
|
|
23
|
+
- Informs the user which server contains the library
|
|
24
|
+
|
|
25
|
+
**Step 2: Locate the specific table**
|
|
26
|
+
- Use `sas-score-find-table` to check if the table exists in the library
|
|
27
|
+
- Possible outcomes:
|
|
28
|
+
- If table exists **only in CAS** → set `server: "cas"`
|
|
29
|
+
- If table exists **only in SAS** → set `server: "sas"`
|
|
30
|
+
- If table exists **in both** → ask the user: *"The table exists in both CAS and SAS. Which server would you prefer to query from?"*
|
|
31
|
+
- If table exists **in neither** → inform user and suggest verifying the table name
|
|
28
32
|
|
|
29
33
|
---
|
|
30
34
|
|
|
@@ -37,8 +41,8 @@ Ask yourself: does the user already have the data in hand?
|
|
|
37
41
|
|
|
38
42
|
| User's Intent | Tool | Example |
|
|
39
43
|
|---|---|---|
|
|
40
|
-
| Get specific raw rows, apply simple filter, retrieve first N records | `read-table` | "Show me 10 rows from customers where status='active'" |
|
|
41
|
-
| Aggregate/summarize, calculate, join tables, analytical question | `sas-query` | "Average salary by department", "Count orders by region" |
|
|
44
|
+
| Get specific raw rows, apply simple filter, retrieve first N records | `sas-score-read-table` | "Show me 10 rows from customers where status='active'" |
|
|
45
|
+
| Aggregate/summarize, calculate, join tables, analytical question | `sas-score-sas-query` | "Average salary by department", "Count orders by region" |
|
|
42
46
|
|
|
43
47
|
---
|
|
44
48
|
|
|
@@ -51,17 +55,17 @@ Ask yourself: does the user already have the data in hand?
|
|
|
51
55
|
|
|
52
56
|
**How:**
|
|
53
57
|
```
|
|
54
|
-
read-table({
|
|
58
|
+
sas-score-read-table({
|
|
55
59
|
table: "tablename",
|
|
56
60
|
lib: "libraryname",
|
|
57
|
-
server: "cas" or "sas", // determined from find-table check
|
|
61
|
+
server: "cas" or "sas", // determined from sas-score-find-table check
|
|
58
62
|
limit: N, // default 10, adjust based on user request
|
|
59
63
|
where: "..." // optional SQL WHERE clause
|
|
60
64
|
})
|
|
61
65
|
```
|
|
62
66
|
|
|
63
67
|
**Rules:**
|
|
64
|
-
- Always determine the server first using `find-table`
|
|
68
|
+
- Always determine the server first using `sas-score-find-table`
|
|
65
69
|
- Keep batch size ≤ 50 rows unless the user explicitly requests more
|
|
66
70
|
- If table name is missing, ask: *"Which table should I read from? (format: lib.tablename)"*
|
|
67
71
|
- If library is missing, ask: *"Which library contains the table?"*
|
|
@@ -87,7 +91,7 @@ sas-query({
|
|
|
87
91
|
```
|
|
88
92
|
|
|
89
93
|
**Rules:**
|
|
90
|
-
- Check which server(s) contain the table using `find-table` first
|
|
94
|
+
- Check which server(s) contain the table using `sas-score-find-table` first
|
|
91
95
|
- If table exists in both CAS and SAS, ask user which to query from
|
|
92
96
|
- Parse the user's natural language question into a PROC SQL SELECT statement
|
|
93
97
|
- Ensure SELECT statement is valid SQL syntax
|
|
@@ -102,22 +106,22 @@ sas-query({
|
|
|
102
106
|
**Pattern A — Raw row retrieval**
|
|
103
107
|
> "Show me the first 5 rows from Public.customers"
|
|
104
108
|
|
|
105
|
-
→ `read-table({ table: "customers", lib: "Public", limit: 5 })`
|
|
109
|
+
→ `sas-score-read-table({ table: "customers", lib: "Public", limit: 5 })`
|
|
106
110
|
|
|
107
111
|
**Pattern B — Filtered retrieval**
|
|
108
112
|
> "Get all high-value orders (amount > 5000) from mylib.orders"
|
|
109
113
|
|
|
110
|
-
→ `read-table({ table: "orders", lib: "mylib", where: "amount > 5000" })`
|
|
114
|
+
→ `sas-score-read-table({ table: "orders", lib: "mylib", where: "amount > 5000" })`
|
|
111
115
|
|
|
112
116
|
**Pattern C — Aggregation**
|
|
113
117
|
> "What is the average price by make in Public.cars?"
|
|
114
118
|
|
|
115
|
-
→ `sas-query({ table: "Public.cars", query: "average price by make", sql: "SELECT make, AVG(msrp) AS avg_price FROM Public.cars GROUP BY make" })`
|
|
119
|
+
→ `sas-score-sas-query({ table: "Public.cars", query: "average price by make", sql: "SELECT make, AVG(msrp) AS avg_price FROM Public.cars GROUP BY make" })`
|
|
116
120
|
|
|
117
121
|
**Pattern D — Join + analysis**
|
|
118
122
|
> "Show me total sales by customer in the sales and customers tables"
|
|
119
123
|
|
|
120
|
-
→ `sas-query()` with a JOIN in the generated SQL
|
|
124
|
+
→ `sas-score-sas-query()` with a JOIN in the generated SQL
|
|
121
125
|
|
|
122
126
|
---
|
|
123
127
|
|
|
@@ -125,19 +129,28 @@ sas-query({
|
|
|
125
129
|
|
|
126
130
|
| Problem | Action |
|
|
127
131
|
|---|---|
|
|
128
|
-
|
|
|
132
|
+
| Library not found | Use `sas-find-library-smart` skill to verify the library exists |
|
|
133
|
+
| Table not found in either server | Inform user and suggest checking the table name |
|
|
129
134
|
| Table exists in both CAS and SAS | Ask: *"The table exists in both servers. Which would you prefer: CAS or SAS?"* |
|
|
130
135
|
| Table exists only in one server | Use that server automatically in your request |
|
|
131
|
-
|
|
|
136
|
+
| Table name missing entirely | Ask: *"Which table should I read from?"* |
|
|
132
137
|
| Ambiguous intent (raw vs aggregate) | Ask: *"Do you want individual rows or a summary by some field?"* |
|
|
133
138
|
| Empty result | Inform user, ask to adjust filter or query |
|
|
134
139
|
|
|
135
140
|
---
|
|
136
141
|
|
|
142
|
+
## Integration with other skills
|
|
143
|
+
|
|
144
|
+
- **Before this skill**: Use `sas-find-library-smart` to verify and locate the library
|
|
145
|
+
- **After this skill**: Use `sas-read-and-score` to score the retrieved data
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
137
149
|
## Next steps
|
|
138
150
|
|
|
139
|
-
Once data is retrieved,
|
|
140
|
-
-
|
|
141
|
-
-
|
|
142
|
-
-
|
|
143
|
-
-
|
|
151
|
+
Once data is retrieved, typical follow-ups include:
|
|
152
|
+
- **Visualize** — present as table or chart
|
|
153
|
+
- **Export** — format and offer download
|
|
154
|
+
- **Analyze further** — ask clarifying questions
|
|
155
|
+
- **Score** — run predictions on the data
|
|
156
|
+
- **Combine** — join with other datasets
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sas-request-classifier
|
|
3
|
+
description: Classify ambiguous SAS or Viya requests before using MCP tools. Use when prompts mention jobs, code, models, scoring, CAS tables, content, or resources and the correct SAS domain is not yet clear.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# SAS Request Classifier
|
|
7
|
+
|
|
8
|
+
Use this skill to determine what kind of SAS object, workflow, or environment the user is referring to before selecting tools.
|
|
9
|
+
|
|
10
|
+
## When to use
|
|
11
|
+
Use this skill when the request contains ambiguous domain terms such as:
|
|
12
|
+
- model
|
|
13
|
+
- score
|
|
14
|
+
- scoring
|
|
15
|
+
- read
|
|
16
|
+
- query
|
|
17
|
+
- job
|
|
18
|
+
- jobdef
|
|
19
|
+
- code
|
|
20
|
+
- table
|
|
21
|
+
- content
|
|
22
|
+
- asset
|
|
23
|
+
- resource
|
|
24
|
+
|
|
25
|
+
Use this skill before any execution-oriented tool call if there is a chance the request is referring to the wrong SAS domain.
|
|
26
|
+
|
|
27
|
+
## Goal
|
|
28
|
+
Map the user request to the most likely SAS domain and hand off to the correct downstream skill or tool path.
|
|
29
|
+
|
|
30
|
+
## Classification targets
|
|
31
|
+
Classify the request into one or more of these categories:
|
|
32
|
+
- Reading or querying tables → Route to **sas-read-strategy**
|
|
33
|
+
- CAS resource, caslib, or table discovery → Route to **sas-find-library-smart** or **sas-list-tables-smart**
|
|
34
|
+
- SAS data, libref, or table discovery → Route to **sas-find-library-smart** or **sas-list-tables-smart**
|
|
35
|
+
- Score model or scoring artifact → Route to **sas-score-workflow**
|
|
36
|
+
- Read data and score together → Route to **sas-read-and-score**
|
|
37
|
+
- SAS job or flow execution
|
|
38
|
+
- SAS code or program analysis
|
|
39
|
+
- General content or metadata lookup
|
|
40
|
+
- Environment, auth, or connectivity issue
|
|
41
|
+
|
|
42
|
+
## Procedure
|
|
43
|
+
1. Read the request and identify ambiguous nouns and verbs.
|
|
44
|
+
2. Infer whether the request is asking to discover, inspect, execute, deploy, score, compare, or troubleshoot.
|
|
45
|
+
3. Decide the most likely SAS domain and matching skill.
|
|
46
|
+
4. If confidence is low, ask one focused clarifying question.
|
|
47
|
+
5. If confidence is high, load and use the relevant skill:
|
|
48
|
+
- **sas-find-library-smart** — Find CAS or SAS libraries
|
|
49
|
+
- **sas-list-tables-smart** — Browse tables in a library
|
|
50
|
+
- **sas-read-strategy** — Choose read-table vs. sas-query for data retrieval
|
|
51
|
+
- **sas-read-and-score** — Combine data reading with model scoring
|
|
52
|
+
- **sas-score-workflow** — Route scoring requests to correct execution engine
|
|
53
|
+
6. Only after classification and skill guidance, use MCP tools.
|
|
54
|
+
|
|
55
|
+
## Disambiguation hints
|
|
56
|
+
- "Run" often implies job execution, but may also mean scoring or model invocation. Check for "score" or "model" context.
|
|
57
|
+
- "Model" may refer to MAS models, SAS jobs, jobdefs, or SCR models. Look for context or type suffix (e.g., `.job`, `.mas`, `.scr`).
|
|
58
|
+
- "Score" may refer to model scoring or job execution. Look for model name or context.
|
|
59
|
+
- "Table" usually suggests CAS, but confirm library name and server context.
|
|
60
|
+
- "Find", "list", "browse" — starts as discovery. Route to sas-find-library-smart or sas-list-tables-smart.
|
|
61
|
+
- "Read", "query", "fetch" — data retrieval. Route to sas-read-strategy.
|
|
62
|
+
- "Predict", "score records", "run model on data" — combined workflow. Route to sas-read-and-score or sas-score-workflow.
|
|
63
|
+
|
|
64
|
+
## Output
|
|
65
|
+
When you finish classification, state:
|
|
66
|
+
- the inferred SAS domain
|
|
67
|
+
- the confidence level
|
|
68
|
+
- the relevant skill(s) to load
|
|
69
|
+
- any remaining ambiguity or clarifying questions needed
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
---
|
|
1
|
+
gi ---
|
|
2
2
|
name: sas-score-workflow
|
|
3
3
|
description: >
|
|
4
4
|
Guide the full model scoring workflow: validate model familiarity, route to appropriate scoring tool
|
|
@@ -25,11 +25,11 @@ score <name>.<type> [scenario =<key=value pairs>]
|
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
**Type determines the routing:**
|
|
28
|
-
- `.job` → route to `run-job` with scoring parameters
|
|
29
|
-
- `.jobdef` → route to `run-jobdef` with scoring parameters
|
|
30
|
-
- `.mas` → route to `model-score` (Model Analytical Service — default)
|
|
31
|
-
- `.scr` → route to `scr-score` (SAS Container Runtime)
|
|
32
|
-
- `.sas` → route to `run-sas-program` to run sas program in folder
|
|
28
|
+
- `.job` → route to `sas-score-run-job` with scoring parameters
|
|
29
|
+
- `.jobdef` → route to `sas-score-run-jobdef` with scoring parameters
|
|
30
|
+
- `.mas` → route to `sas-score-model-score` (Model Analytical Service — default)
|
|
31
|
+
- `.scr` → route to `sas-score-scr-score` (SAS Container Runtime)
|
|
32
|
+
- `.sas` → route to `sas-score-run-sas-program` to run sas program in folder
|
|
33
33
|
|
|
34
34
|
If no type is specified (bare model name), assume `.mas` (MAS model).
|
|
35
35
|
|
|
@@ -51,39 +51,39 @@ When a user provides a model name with a type suffix (e.g., `simplejon.job`, `ch
|
|
|
51
51
|
|
|
52
52
|
3. **Strip the type suffix:** Remove the `.type` from the model name before passing to the routing tool
|
|
53
53
|
- **Critical:** Always pass the base name (without the dot and type) to the invoked tool
|
|
54
|
-
- `simplejon.job` → pass `simplejon` to `run-job`
|
|
55
|
-
- `churn.mas` → pass `churn` to `model-score`
|
|
56
|
-
- `fraud_detector.jobdef` → pass `fraud_detector` to `run-jobdef`
|
|
54
|
+
- `simplejon.job` → pass `simplejon` to `sas-score-run-job`
|
|
55
|
+
- `churn.mas` → pass `churn` to `sas-score-model-score`
|
|
56
|
+
- `fraud_detector.jobdef` → pass `fraud_detector` to `sas-score-run-jobdef`
|
|
57
57
|
|
|
58
58
|
### Type: `.mas` (Model Aggregation Service)
|
|
59
|
-
- **Tool**: `model-score`
|
|
59
|
+
- **Tool**: `sas-score-model-score`
|
|
60
60
|
- **Use for**: Standard MAS-deployed predictive models
|
|
61
61
|
- **Example**: `score with model churn.mas scenario =age=45,income=60000`
|
|
62
|
-
- **Invocation**: `model-score({ model: "churn", scenario: {...} })`
|
|
62
|
+
- **Invocation**: `sas-score-model-score({ model: "churn", scenario: {...} })`
|
|
63
63
|
|
|
64
64
|
### Type: `.job` (SAS Viya Job)
|
|
65
|
-
- **Tool**: `run-job`
|
|
65
|
+
- **Tool**: `sas-score-run-job`
|
|
66
66
|
- **Use for**: Pre-built scoring jobs with parameters
|
|
67
67
|
- **Example**: `score with model monthly_scorer.job scenario =month=10,year=2025`
|
|
68
|
-
- **Invocation**: `run-job({ name: "monthly_scorer", scenario: {...} })`
|
|
68
|
+
- **Invocation**: `sas-score-run-job({ name: "monthly_scorer", scenario: {...} })`
|
|
69
69
|
|
|
70
70
|
### Type: `.jobdef` (SAS Viya Job Definition)
|
|
71
|
-
- **Tool**: `run-jobdef`
|
|
71
|
+
- **Tool**: `sas-score-run-jobdef`
|
|
72
72
|
- **Use for**: Job definitions that perform scoring logic
|
|
73
73
|
- **Example**: `score with model fraud_detector.jobdef using amount=500,merchant=online`
|
|
74
|
-
- **Invocation**: `run-jobdef({ name: "fraud_detector", scenario: {...} })`
|
|
74
|
+
- **Invocation**: `sas-score-run-jobdef({ name: "fraud_detector", scenario: {...} })`
|
|
75
75
|
|
|
76
76
|
### Type: `.scr` (Score Code Runtime)
|
|
77
|
-
- **Tool**: `scr-score`
|
|
77
|
+
- **Tool**: `sas-score-scr-score`
|
|
78
78
|
- **Use for**: Models deployed in SCR containers (REST endpoints)
|
|
79
79
|
- **Example**: `score https://scr-host/models/loan.scr using age=45,credit=700`
|
|
80
|
-
- **Invocation**: `scr-score({ url: "https://scr-host/models/loan", scenario: {...} })`
|
|
80
|
+
- **Invocation**: `sas-score-scr-score({ url: "https://scr-host/models/loan", scenario: {...} })`
|
|
81
81
|
|
|
82
82
|
### Type: `.sas` (SAS Program / SQL)
|
|
83
|
-
- **Tool**: `run-sas-program`
|
|
83
|
+
- **Tool**: `sas-score-run-sas-program`
|
|
84
84
|
- **Use for**: Custom SAS or SQL scoring code
|
|
85
85
|
- **Example**: `score my_scoring_code.sas using x=1,y=2`
|
|
86
|
-
- **Invocation**: `run-sas-program({ folder: "my_scoring_code", scenario: {...} })`
|
|
86
|
+
- **Invocation**: `sas-score-run-sas-program({ folder: "my_scoring_code", scenario: {...} })`
|
|
87
87
|
|
|
88
88
|
|
|
89
89
|
|
|
@@ -106,6 +106,13 @@ Accepted formats:
|
|
|
106
106
|
|
|
107
107
|
---
|
|
108
108
|
|
|
109
|
+
## Integration with other skills
|
|
110
|
+
|
|
111
|
+
- **Before scoring table data**: Use `sas-find-library-smart` to verify the library, then `sas-read-strategy` to fetch records
|
|
112
|
+
- **For read + score workflows**: Use `sas-read-and-score` for the complete end-to-end pattern
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
109
116
|
## Step 1 — Check model familiarity before scoring
|
|
110
117
|
|
|
111
118
|
Score immediately if:
|
|
@@ -139,7 +146,7 @@ scenario = [
|
|
|
139
146
|
```
|
|
140
147
|
|
|
141
148
|
**Critical rules:**
|
|
142
|
-
- Loop or call model-score **once per row**.
|
|
149
|
+
- Loop or call sas-score-model-score **once per row**.
|
|
143
150
|
- Field names in the scenario must match the model's expected input variable names **exactly**.
|
|
144
151
|
- If table column names differ from model input names, **flag this to the user** and ask for confirmation before scoring.
|
|
145
152
|
- Example: Table has `age_years`, but model expects `age` → ask user which column maps to which input.
|
|
@@ -153,7 +160,7 @@ Based on the type extracted from the model name, invoke the corresponding tool:
|
|
|
153
160
|
|
|
154
161
|
**For `.mas` (default):**
|
|
155
162
|
```javascript
|
|
156
|
-
model-score({
|
|
163
|
+
sas-score-model-score({
|
|
157
164
|
model: "<modelname>",
|
|
158
165
|
scenario: scenario, // object or array
|
|
159
166
|
uflag: false // set true if you need field names prefixed with _
|
|
@@ -162,7 +169,7 @@ model-score({
|
|
|
162
169
|
|
|
163
170
|
**For `.job`:**
|
|
164
171
|
```javascript
|
|
165
|
-
run-job({
|
|
172
|
+
sas-score-run-job({
|
|
166
173
|
name: "<jobname>",
|
|
167
174
|
scenario: scenario
|
|
168
175
|
})
|
|
@@ -170,7 +177,7 @@ run-job({
|
|
|
170
177
|
|
|
171
178
|
**For `.jobdef`:**
|
|
172
179
|
```javascript
|
|
173
|
-
run-jobdef({
|
|
180
|
+
sas-score-run-jobdef({
|
|
174
181
|
name: "<jobdefname>",
|
|
175
182
|
scenario: scenario
|
|
176
183
|
})
|
|
@@ -178,7 +185,7 @@ run-jobdef({
|
|
|
178
185
|
|
|
179
186
|
**For `.scr`:**
|
|
180
187
|
```javascript
|
|
181
|
-
scr-score({
|
|
188
|
+
sas-score-scr-score({
|
|
182
189
|
url: "<scr_endpoint_url>",
|
|
183
190
|
scenario: scenario
|
|
184
191
|
})
|
|
@@ -186,7 +193,7 @@ scr-score({
|
|
|
186
193
|
|
|
187
194
|
**For `.sas`:**
|
|
188
195
|
```javascript
|
|
189
|
-
run-sas-program({
|
|
196
|
+
sas-score-run-sas-program({
|
|
190
197
|
src: "<sas_or_sql_code>",
|
|
191
198
|
scenario: scenario
|
|
192
199
|
})
|
|
@@ -222,43 +229,43 @@ Merge the scoring output back with the input records and present as a table wher
|
|
|
222
229
|
**Flow A — Score rows with MAS model**
|
|
223
230
|
> "Score the first 10 customers in Public.customers with the churn model"
|
|
224
231
|
|
|
225
|
-
1. `read-table` → { table: "Public.customers", limit: 10 }
|
|
226
|
-
2. `model-score` → { model: "churn", scenario: [ ...10 row objects ] }
|
|
232
|
+
1. `sas-score-read-table` → { table: "Public.customers", limit: 10 }
|
|
233
|
+
2. `sas-score-model-score` → { model: "churn", scenario: [ ...10 row objects ] }
|
|
227
234
|
3. Present merged results with prediction + key inputs
|
|
228
235
|
|
|
229
236
|
**Flow B — Score with a scoring job**
|
|
230
237
|
> "Score December sales with the monthly_scorer job using month=12,year=2025"
|
|
231
238
|
|
|
232
|
-
1. `run-job` → { name: "monthly_scorer", scenario: { month: "12", year: "2025" } }
|
|
239
|
+
1. `sas-score-run-job` → { name: "monthly_scorer", scenario: { month: "12", year: "2025" } }
|
|
233
240
|
2. Capture job output and tables
|
|
234
241
|
3. Present results
|
|
235
242
|
|
|
236
243
|
**Flow C — Score with a job definition**
|
|
237
244
|
> "Run fraud detection jobdef on transaction amount=500, merchant=online"
|
|
238
245
|
|
|
239
|
-
1. `run-jobdef` → { name: "fraud_detection", scenario: { amount: "500", merchant: "online" } }
|
|
246
|
+
1. `sas-score-run-jobdef` → { name: "fraud_detection", scenario: { amount: "500", merchant: "online" } }
|
|
240
247
|
2. Capture log, listings, and tables
|
|
241
248
|
3. Present results
|
|
242
249
|
|
|
243
250
|
**Flow D — Score with SCR endpoint**
|
|
244
251
|
> "Score with the loan model at https://scr-host/models/loan using age=45, credit_score=700"
|
|
245
252
|
|
|
246
|
-
1. `scr-score` → { url: "https://scr-host/models/loan", scenario: { age: "45", credit_score: "700" } }
|
|
253
|
+
1. `sas-score-scr-score` → { url: "https://scr-host/models/loan", scenario: { age: "45", credit_score: "700" } }
|
|
247
254
|
2. Capture prediction response
|
|
248
255
|
3. Present result
|
|
249
256
|
|
|
250
257
|
**Flow E — Score results of an analytical query with MAS**
|
|
251
258
|
> "Score high-value customers (spend > 5000) in mylib.sales with the fraud model"
|
|
252
259
|
|
|
253
|
-
1. `sas-query` → { table: "mylib.sales", sql: "SELECT * FROM mylib.sales WHERE spend > 5000" }
|
|
254
|
-
2. `model-score` → { model: "fraud", scenario: [ ...result rows ] }
|
|
260
|
+
1. `sas-score-sas-query` → { table: "mylib.sales", sql: "SELECT * FROM mylib.sales WHERE spend > 5000" }
|
|
261
|
+
2. `sas-score-model-score` → { model: "fraud", scenario: [ ...result rows ] }
|
|
255
262
|
3. Present merged results
|
|
256
263
|
|
|
257
264
|
**Flow F — User supplies scenario data directly**
|
|
258
265
|
> "Score age=45, income=60000, region=South with the churn model"
|
|
259
266
|
|
|
260
267
|
1. Skip read step
|
|
261
|
-
2. `model-score` → { model: "churn", scenario: { age: "45", income: "60000", region: "South" } }
|
|
268
|
+
2. `sas-score-model-score` → { model: "churn", scenario: { age: "45", income: "60000", region: "South" } }
|
|
262
269
|
3. Present result
|
|
263
270
|
|
|
264
271
|
**Flow G — Model unfamiliar, need to confirm**
|
|
@@ -266,7 +273,7 @@ Merge the scoring output back with the input records and present as a table wher
|
|
|
266
273
|
|
|
267
274
|
1. Pause — "creditRisk2" is new
|
|
268
275
|
2. Suggest: `find-model` to confirm it exists, `model-info` to get input variables
|
|
269
|
-
3. Once confirmed → `read-table` + `model-score`
|
|
276
|
+
3. Once confirmed → `sas-score-read-table` + `sas-score-model-score`
|
|
270
277
|
|
|
271
278
|
**Flow H — Generic score syntax with type routing**
|
|
272
279
|
> "score with model churn.mas scenario =age=45,income=60000"
|
|
@@ -294,7 +301,14 @@ Merge the scoring output back with the input records and present as a table wher
|
|
|
294
301
|
|
|
295
302
|
## Tips
|
|
296
303
|
|
|
297
|
-
- **Batch is better:** Always pass the full set of records in one `model-score` call. Do not loop.
|
|
304
|
+
- **Batch is better:** Always pass the full set of records in one `sas-score-model-score` call. Do not loop.
|
|
298
305
|
- **Confirm mappings:** If column names don't match model inputs, ask before scoring.
|
|
299
306
|
- **Show context:** Include key input columns in the result output so predictions make sense.
|
|
300
307
|
- **Limit output:** For large result sets (>10 rows), ask before showing all.
|
|
308
|
+
|
|
309
|
+
---
|
|
310
|
+
|
|
311
|
+
## Integration with other skills
|
|
312
|
+
|
|
313
|
+
- **Before scoring table data**: Use `sas-find-library-smart` to verify the library, then `sas-read-strategy` to fetch records
|
|
314
|
+
- **For read + score workflows**: Use `sas-read-and-score` for the complete end-to-end pattern
|