@sassoftware/sas-score-mcp-serverjs 1.0.1-13 → 1.0.1-14
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.
|
@@ -26,7 +26,7 @@ Before using SAS MCP tools, classify the request into one of these categories:
|
|
|
26
26
|
- SAS code or program analysis
|
|
27
27
|
- CAS data, caslibs, tables, or resources
|
|
28
28
|
- SAS data, librefs, tables, or resources
|
|
29
|
-
- MAS model, SAS job model, SAS jobdef model
|
|
29
|
+
- MAS model, SAS job model, SAS jobdef model, SCR model
|
|
30
30
|
- Score model / scoring artifact / scoring execution
|
|
31
31
|
- General SAS content or metadata discovery
|
|
32
32
|
- Authentication, connection, or environment issue
|
|
@@ -38,7 +38,7 @@ Before invoking MCP tools, decide whether one or more SAS skills should be used.
|
|
|
38
38
|
Prefer loading the most relevant SAS skill for the request category.
|
|
39
39
|
Use more than one skill only when the task clearly spans multiple domains, for example:
|
|
40
40
|
- CAS discovery + scoring
|
|
41
|
-
- model
|
|
41
|
+
- find model + score workflow
|
|
42
42
|
- content discovery + code analysis
|
|
43
43
|
|
|
44
44
|
Do not load unrelated skills.
|
|
@@ -131,6 +131,28 @@ See also: `./enforce-find-resource-strategy.md` for details and examples.
|
|
|
131
131
|
|
|
132
132
|
---
|
|
133
133
|
|
|
134
|
+
# Scoring workflow envforcement (MANDATORY)
|
|
135
|
+
|
|
136
|
+
For any request to score with a model (e.g., "score with model abc", "run model abc.jobdef", "score with model abc.mas", "score with model abc.scr"), you MUST follow this workflow:
|
|
137
|
+
Step 1. **Always use the sas-find-resource-strategy**
|
|
138
|
+
|
|
139
|
+
- For models of type MAS, job, or jobdef:
|
|
140
|
+
- Use the `sas-find-resource-strategy` skill to verify the model exists before scoring, except for SCR models where the model existence check is not required before scoring.
|
|
141
|
+
- Do not assume the model exists or skip this step, even if the model name is commonly used.
|
|
142
|
+
- If a table is used as data source for scoring, use the `sas-find-resource-strategy` skill to locate the table and determine which server (CAS or SAS) contains it.
|
|
143
|
+
- Do not assume the server or skip this step, even if the library or table is commonly found in one server.
|
|
144
|
+
- If the table exists in both, ask the user which server to use.
|
|
145
|
+
- If the table is not found, inform the user and do not attempt to read.
|
|
146
|
+
|
|
147
|
+
Step 2. **Only after confirming the table location:**
|
|
148
|
+
- Use the correct `sas-score-read-table` or `sas-score-sas-query` tool, specifying the server explicitly.
|
|
149
|
+
|
|
150
|
+
3. **If you see a direct read-table/tool call without a prior find step:**
|
|
151
|
+
- Correct the workflow and restart from the find resource step.
|
|
152
|
+
|
|
153
|
+
This workflow is mandatory for all score requests. If you are unsure, always perform the find resource step before scoring.
|
|
154
|
+
|
|
155
|
+
---
|
|
134
156
|
|
|
135
157
|
# Available Skills
|
|
136
158
|
|
|
@@ -19,11 +19,10 @@ with a deployed MAS model.
|
|
|
19
19
|
|
|
20
20
|
## Pre-flight verification
|
|
21
21
|
|
|
22
|
-
**Before attempting to read or score table
|
|
23
|
-
1. **Verify
|
|
24
|
-
2. **Verify
|
|
25
|
-
3. **
|
|
26
|
-
4. **Confirm server location**: Ensure you know which server (CAS or SAS) contains the data
|
|
22
|
+
**Before attempting to read, query, or score a table:**
|
|
23
|
+
1. **Verify table exists**: Use `sas-find-resource-strategy` to confirm the library and table exist before trying to read
|
|
24
|
+
2. **Verify model exists**: Use `sas-find-resource-strategy` to confirm the model exists before scoring, except for SCR models
|
|
25
|
+
3. **Confirm server location**: Ensure you know which server (CAS or SAS) contains the data
|
|
27
26
|
|
|
28
27
|
This ensures consistent behavior with other data access operations.
|
|
29
28
|
|
|
@@ -42,8 +41,8 @@ The typical flow involves:
|
|
|
42
41
|
## Scenario: User already has data
|
|
43
42
|
|
|
44
43
|
If the user provides scenario data directly (e.g., "Score age=45, income=60000 with model X"):
|
|
45
|
-
- Extract the scenario values
|
|
46
|
-
- Validate against model's input schema
|
|
44
|
+
- Extract the scenario values and format it as a json object(ex: a=10,b=20 → {"a":10,"b":20})
|
|
45
|
+
- Validate against model's input schema if model is mas or scr.
|
|
47
46
|
- Invoke scoring
|
|
48
47
|
- Return prediction
|
|
49
48
|
|
|
@@ -52,8 +51,8 @@ If the user provides scenario data directly (e.g., "Score age=45, income=60000 w
|
|
|
52
51
|
## Scenario: User wants to score table rows
|
|
53
52
|
|
|
54
53
|
If the user specifies a table (e.g., "Score all customers in Public.customers with model X"):
|
|
54
|
+
- Verify table exists using `sas-find-resource-strategy`
|
|
55
55
|
- Fetch raw rows (possibly filtered: "where status='active'")
|
|
56
|
-
- Validate model compatibility with input columns
|
|
57
56
|
- Invoke scoring on each row
|
|
58
57
|
- Merge results with original data
|
|
59
58
|
- Display combined table
|
|
@@ -64,7 +63,6 @@ If the user specifies a table (e.g., "Score all customers in Public.customers wi
|
|
|
64
63
|
|
|
65
64
|
If the user wants to score aggregated/filtered results (e.g., "Score high-value customers (spend > 5000) with model X"):
|
|
66
65
|
- Determine which records meet criteria (aggregation/filtering)
|
|
67
|
-
- Validate model expects these input columns
|
|
68
66
|
- Invoke scoring
|
|
69
67
|
- Merge predictions with summary data
|
|
70
68
|
- Display results
|
|
@@ -83,9 +81,8 @@ If the user specifies a model name that's new/unknown:
|
|
|
83
81
|
|
|
84
82
|
## Rules
|
|
85
83
|
|
|
86
|
-
- Always validate table
|
|
84
|
+
- Always validate table existence before attempting to read
|
|
87
85
|
- Always check model exists before invoking `sas-score-model-score`
|
|
88
|
-
- Match table columns to model input variables; warn on mismatch
|
|
89
86
|
- Use find tools only for resource existence checks; do not use list tools to find resources
|
|
90
87
|
- If multiple records: score batch if possible; fall back to row-by-row
|
|
91
88
|
- Merge predictions with original data using row index or key column
|
|
@@ -108,6 +105,6 @@ If the user specifies a model name that's new/unknown:
|
|
|
108
105
|
|
|
109
106
|
## Integration with other skills
|
|
110
107
|
|
|
111
|
-
- **Before this workflow**: Use `sas-find-resource-strategy` to verify
|
|
108
|
+
- **Before this workflow**: Use `sas-find-resource-strategy` to verify table/model resources exist
|
|
112
109
|
- **For data retrieval**: Use `sas-read-strategy` to choose the right read tool (read-table vs sas-query)
|
|
113
110
|
- **For scoring**: Use `sas-score-workflow-strategy` for advanced scoring options beyond MAS models
|
|
@@ -20,6 +20,7 @@ Before retrieving data, locate the specific table first and determine which serv
|
|
|
20
20
|
**Step 1: Locate the specific table (table-first)**
|
|
21
21
|
- Use `sas-find-resource-strategy` to check if the table exists in CAS first, then SAS if needed
|
|
22
22
|
- Do not perform a separate library-first lookup; table lookup already handles server-aware discovery
|
|
23
|
+
- Do not use list tools for existence checks; rely on find tools to determine if the resource exists and where it exists.
|
|
23
24
|
- Possible outcomes:
|
|
24
25
|
- If table exists **only in CAS** → set `server: "cas"`
|
|
25
26
|
- If table exists **only in SAS** → set `server: "sas"`
|
|
@@ -51,6 +52,8 @@ Ask yourself: does the user already have the data in hand?
|
|
|
51
52
|
|
|
52
53
|
|
|
53
54
|
**How:**
|
|
55
|
+
|
|
56
|
+
Step 1: Determine
|
|
54
57
|
```
|
|
55
58
|
sas-score-read-table({
|
|
56
59
|
table: "tablename",
|
|
@@ -81,6 +84,9 @@ sas-score-read-table({
|
|
|
81
84
|
- User's question is phrased analytically ("compare", "analyze", "breakdown", "trend")
|
|
82
85
|
|
|
83
86
|
**How:**
|
|
87
|
+
1. Use `sas-find-resource-strategy` to check if the table exists in CAS first, then SAS if needed
|
|
88
|
+
2. If table does not exist inform the user and suggest verifying the table name
|
|
89
|
+
3. If table exists run the sas-query tool with the appropriate server and a generated SQL statement based on the user's natural language question. For example:
|
|
84
90
|
```
|
|
85
91
|
sas-query({
|
|
86
92
|
table: "lib.tablename",
|
|
@@ -51,7 +51,7 @@ Classify the request into one or more of these categories:
|
|
|
51
51
|
- **sas-find-resource-strategy** — Unified find-only strategy for library/table/mas/job/jobdef, where "model" may mean mas, job, or jobdef
|
|
52
52
|
- **sas-list-resource-strategy** — Unified list strategy for library/table/mas/job/jobdef, where "model" may mean mas, job, or jobdef, with non-null pagination defaults
|
|
53
53
|
- **sas-find-library-smart** — Find CAS or SAS libraries
|
|
54
|
-
- **sas-list-tables-smart** —
|
|
54
|
+
- **sas-list-tables-smart** — List tables in a library
|
|
55
55
|
- **sas-read-strategy** — Choose read-table vs. sas-query for data retrieval
|
|
56
56
|
- **sas-read-and-score-strategy** — Combine data reading with model scoring
|
|
57
57
|
- **sas-score-workflow-strategy** — Route scoring requests to correct execution engine
|
|
@@ -59,7 +59,7 @@ Classify the request into one or more of these categories:
|
|
|
59
59
|
|
|
60
60
|
## Disambiguation hints
|
|
61
61
|
- "Run" often implies job execution, but may also mean scoring or model invocation. Check for "score" or "model" context.
|
|
62
|
-
- "Model" is a generic term that may refer to MAS, job, or jobdef resources in find/list requests. Prefer explicit patterns like `model <type>` or `<type> model`; default bare "model" to MAS unless the surrounding request implies job or jobdef.
|
|
62
|
+
- "Model" is a generic term that may refer to MAS, SCR,job, or jobdef resources in find/list requests. Prefer explicit patterns like `model <type>` or `<type> model`; default bare "model" to MAS unless the surrounding request implies job or jobdef.
|
|
63
63
|
- "Score" may refer to model scoring or job execution. Look for model name or context.
|
|
64
64
|
- "Table" usually suggests CAS or SAS but confirm library name and server context.
|
|
65
65
|
- "Find" — resource lookup. Route to sas-find-resource-strategy.
|