@sassoftware/sas-score-mcp-serverjs 1.0.1-3 → 1.0.1-4

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.
Files changed (30) hide show
  1. package/package.json +2 -3
  2. package/src/oauthHandlers/callback.js +1 -1
  3. package/src/processHeaders.js +1 -1
  4. package/src/setupSkills.js +1 -1
  5. package/.skills_claude/README.md +0 -303
  6. package/.skills_claude/TESTING_GUIDE.md +0 -252
  7. package/.skills_claude/agents/sas-viya-scoring-expert.md +0 -58
  8. package/.skills_claude/claude-desktop-config.json +0 -16
  9. package/.skills_claude/claude-desktop-system-prompt.md +0 -127
  10. package/.skills_claude/copilot-instructions.md +0 -155
  11. package/.skills_claude/instructions.md +0 -184
  12. package/.skills_claude/skills/sas-find-library-smart/SKILL.md +0 -157
  13. package/.skills_claude/skills/sas-find-resource-strategy/SKILL.md +0 -105
  14. package/.skills_claude/skills/sas-list-resource-strategy/SKILL.md +0 -124
  15. package/.skills_claude/skills/sas-list-tables-smart/SKILL.md +0 -126
  16. package/.skills_claude/skills/sas-read-and-score/SKILL.md +0 -112
  17. package/.skills_claude/skills/sas-read-strategy/SKILL.md +0 -154
  18. package/.skills_claude/skills/sas-request-classifier/SKILL.md +0 -69
  19. package/.skills_claude/skills/sas-score-workflow/SKILL.md +0 -200
  20. package/.skills_claude/skills-index.md +0 -345
  21. package/.skills_github/agents/sas-viya-scoring-expert.md +0 -58
  22. package/.skills_github/copilot-instructions.md +0 -177
  23. package/.skills_github/skills/sas-find-library-smart/SKILL.md +0 -155
  24. package/.skills_github/skills/sas-find-resource-strategy/SKILL.md +0 -105
  25. package/.skills_github/skills/sas-list-resource-strategy/SKILL.md +0 -124
  26. package/.skills_github/skills/sas-list-tables-smart/SKILL.md +0 -128
  27. package/.skills_github/skills/sas-read-and-score/SKILL.md +0 -113
  28. package/.skills_github/skills/sas-read-strategy/SKILL.md +0 -154
  29. package/.skills_github/skills/sas-request-classifier/SKILL.md +0 -74
  30. package/.skills_github/skills/sas-score-workflow/SKILL.md +0 -314
@@ -1,105 +0,0 @@
1
- ---
2
- name: sas-find-resource-strategy
3
- description: >
4
- Unified strategy for finding SAS Viya resources using find tools only. Supports library, table,
5
- model, job, and jobdef lookup with server-aware behavior for CAS/SAS resources. Use this skill
6
- whenever the task is to verify whether a resource exists.
7
- ---
8
-
9
- # SAS Find Resource Strategy
10
-
11
- Use this skill to verify resource existence without using list tools.
12
-
13
- ## Scope
14
-
15
- Supported resource types:
16
- - library
17
- - table
18
- - model
19
- - job
20
- - jobdef
21
-
22
- ## Mandatory rule
23
-
24
- - Use only find tools to verify existence.
25
- - Do not use list tools to find a resource.
26
-
27
- ## Tool mapping
28
-
29
- - Library -> `sas-score-find-library`
30
- - Table -> `sas-score-find-table`
31
- - Model -> `sas-score-find-model`
32
- - Job -> `sas-score-find-job`
33
- - Jobdef -> `sas-score-find-jobdef`
34
-
35
- ## Strategy by resource type
36
-
37
- ### Find library
38
-
39
- If server is provided:
40
- - CAS: `sas-score-find-library({ name: "<lib>", server: "cas" })`
41
- - SAS: uppercase first, then `sas-score-find-library({ name: "<LIB>", server: "sas" })`
42
-
43
- If server is not provided:
44
- 1. Check CAS first.
45
- 2. If not found, check SAS with uppercase library name.
46
- 3. Report where found, or report not found in either.
47
-
48
- ### Find table
49
-
50
- Required inputs:
51
- - library name
52
- - table name
53
-
54
- If server is provided:
55
- - CAS: `sas-score-find-table({ lib: "<lib>", name: "<table>", server: "cas" })`
56
- - SAS: uppercase library first, then `sas-score-find-table({ lib: "<LIB>", name: "<table>", server: "sas" })`
57
-
58
- If server is not provided:
59
- 1. Check CAS first.
60
- 2. If not found, check SAS (uppercase library).
61
- 3. If found in both, report both and ask user which server to use for follow-up reads.
62
-
63
- ### Find model
64
-
65
- Use:
66
- - `sas-score-find-model({ name: "<model>" })`
67
-
68
- If a model type suffix is provided (for example `.mas`, `.job`, `.jobdef`, `.scr`):
69
- - For MAS model discovery, strip suffix and look up base name with `sas-score-find-model`.
70
- - For `.job` and `.jobdef`, use job and jobdef find tools instead of model find.
71
-
72
- ### Find job
73
-
74
- Use:
75
- - `sas-score-find-job({ name: "<job>" })`
76
-
77
- ### Find jobdef
78
-
79
- Use:
80
- - `sas-score-find-jobdef({ name: "<jobdef>" })`
81
-
82
- ## Clarifying prompts
83
-
84
- Ask one focused question if required fields are missing:
85
- - Library missing for table lookup: "Which library contains the table?"
86
- - Table name missing: "Which table name should I check?"
87
- - Resource type ambiguous: "Do you want me to find a library, table, model, job, or jobdef?"
88
-
89
- ## Output format
90
-
91
- For found resources:
92
- - Confirm exact resource name returned by the tool.
93
- - Confirm server when applicable (CAS/SAS).
94
-
95
- For not found resources:
96
- - State that the resource was not found.
97
- - Ask for corrected name or server context.
98
-
99
- ## Examples
100
-
101
- - "find library Samples" -> CAS first, then SAS fallback using uppercase.
102
- - "find table costchange in Samples" -> CAS first, then SAS fallback using uppercase library.
103
- - "find model breastcancer" -> `sas-score-find-model`.
104
- - "find job simplejob" -> `sas-score-find-job`.
105
- - "find jobdef daily_run" -> `sas-score-find-jobdef`.
@@ -1,124 +0,0 @@
1
- ---
2
- name: sas-list-resource-strategy
3
- description: >
4
- Unified strategy for listing SAS Viya resources using list tools. Supports libraries,
5
- tables, models, jobs, and jobdefs. Always normalize pagination so start and limit are
6
- never null: default start=1 and limit=10 when not provided.
7
- ---
8
-
9
- # SAS List Resource Strategy
10
-
11
- Use this skill to list resources with consistent pagination defaults.
12
-
13
- ## Scope
14
-
15
- Supported resource types:
16
- - library
17
- - table
18
- - model
19
- - job
20
- - jobdef
21
-
22
- ## Mandatory pagination rule
23
-
24
- For every list operation:
25
- - `start` must never be null
26
- - `limit` must never be null
27
- - If `start` is missing or null, set `start: 1`
28
- - If `limit` is missing or null, set `limit: 10`
29
-
30
- Normalization pattern:
31
- ```
32
- start = (start == null) ? 1 : start
33
- limit = (limit == null) ? 10 : limit
34
- ```
35
-
36
- ## Tool mapping
37
-
38
- - Library -> `sas-score-list-libraries`
39
- - Table -> `sas-score-list-tables`
40
- - Model -> `sas-score-list-models`
41
- - Job -> `sas-score-list-jobs`
42
- - Jobdef -> `sas-score-list-jobdefs`
43
-
44
- ## Strategy by resource type
45
-
46
- ### List libraries
47
-
48
- Use:
49
- ```
50
- sas-score-list-libraries({
51
- server: "all" | "cas" | "sas", // optional based on user intent
52
- start: 1,
53
- limit: 10
54
- })
55
- ```
56
-
57
- If user provides server, honor it. If not, use default server behavior.
58
-
59
- ### List tables
60
-
61
- Required input:
62
- - library name (`lib`)
63
-
64
- Use:
65
- ```
66
- sas-score-list-tables({
67
- lib: "libraryname",
68
- server: "cas" | "sas", // optional if strategy/tool supports detection
69
- start: 1,
70
- limit: 10
71
- })
72
- ```
73
-
74
- If `lib` is missing, ask: "Which library should I list tables from?"
75
-
76
- ### List models
77
-
78
- Use:
79
- ```
80
- sas-score-list-models({
81
- start: 1,
82
- limit: 10
83
- })
84
- ```
85
-
86
- ### List jobs
87
-
88
- Use:
89
- ```
90
- sas-score-list-jobs({
91
- start: 1,
92
- limit: 10
93
- })
94
- ```
95
-
96
- ### List jobdefs
97
-
98
- Use:
99
- ```
100
- sas-score-list-jobdefs({
101
- start: 1,
102
- limit: 10
103
- })
104
- ```
105
-
106
- ## Clarifying prompts
107
-
108
- Ask one focused question if required context is missing:
109
- - Resource type unclear: "Do you want libraries, tables, models, jobs, or jobdefs?"
110
- - Listing tables without library: "Which library should I list tables from?"
111
-
112
- ## Output and paging
113
-
114
- - Return the listed resources from the selected tool.
115
- - If result count equals `limit`, suggest next page with `start + limit`.
116
- - Keep using normalized pagination defaults unless user overrides.
117
-
118
- ## Examples
119
-
120
- - "list jobs" -> `sas-score-list-jobs({ start: 1, limit: 10 })`
121
- - "list models" -> `sas-score-list-models({ start: 1, limit: 10 })`
122
- - "list jobdefs" -> `sas-score-list-jobdefs({ start: 1, limit: 10 })`
123
- - "list tables in Public" -> `sas-score-list-tables({ lib: "Public", start: 1, limit: 10 })`
124
- - "next jobs" after `{ start: 1, limit: 10 }` -> `sas-score-list-jobs({ start: 11, limit: 10 })`
@@ -1,126 +0,0 @@
1
- ---
2
- name: sas-list-tables-smart
3
- description: >
4
- List all tables in a SAS Viya library with intelligent server detection. When the server is not
5
- specified, automatically checks CAS first, then SAS if not found. Informs the user if the library
6
- does not exist in either server. Use this skill when the user wants to browse or explore available
7
- tables. Trigger phrases include: "list tables in", "show tables in", "what tables are in",
8
- "browse tables in", "tables in library", "enumerate tables", or any request to explore data sources.
9
- ---
10
-
11
- # Smart Data Access in SAS Library (List, Read, Query)
12
-
13
- Intelligently enumerates tables in a SAS Viya library, automatically determining the correct server
14
- when not explicitly specified.
15
-
16
- > **Pre-flight check**: Before listing tables, verify the library and table context using the `sas-find-resource-strategy` skill.
17
- > This ensures consistent server detection across all data operations.
18
-
19
- **If the user specifies the server explicitly** (e.g., "list tables in Public in cas"):
20
- - Use the specified server: `server: "cas"` or `server: "sas"`
21
- - Proceed directly to listing tables
22
-
23
- **If the server is NOT specified:**
24
- 1. **First attempt**: Check CAS (`server: "cas"`)
25
- 2. **If no tables found in CAS**: Check SAS (`server: "sas"`)
26
- 3. **If no tables found in either**:
27
- - Inform user: *"The library '&lt;lib&gt;' was not found in CAS or SAS. Please verify the library name is correct."*
28
- - Ask for corrected library name or explicit server context
29
-
30
- ---
31
-
32
- ## Using sas-score-list-tables
33
-
34
- **When:**
35
- - User wants to browse all tables in a library
36
- - User wants to see what data is available
37
- - User wants to explore library contents before querying
38
-
39
- **How:**
40
- ```
41
- sas-score-list-tables({
42
- lib: "libraryname", // required
43
- server: "cas" or "sas", // required; determined by server check
44
- limit: 10, // optional; default 10, adjust for pagination
45
- start: 1 // optional; default 1, use for pagination
46
- })
47
- ```
48
-
49
- **Rules:**
50
- - Always determine the correct server first (cas → sas → neither)
51
- - **For SAS server: always uppercase the library name** (e.g., "maps" → "MAPS")
52
- - If library name is missing, ask: *"Which library should I list tables from?"*
53
- - Default page size is 10; adjust based on user request ("show me all", "25 tables", etc.)
54
- - If returned table count equals the limit, suggest pagination: *"There may be more tables. Use `start: {next_offset}` to see more."*
55
- - If no tables are found despite library existing, report: *"No tables found in {lib} on {server} server."*
56
- - Return table names only; do not fetch table metadata unless explicitly requested
57
-
58
- ---
59
-
60
- ## Smart server detection logic
61
-
62
- ```
63
- IF server specified by user
64
- → IF server is "sas"
65
- → uppercase lib
66
- → use that server
67
- ELSE
68
- → TRY sas-score-list-tables(lib, server="cas")
69
- IF tables found
70
- → success, return tables
71
- ELSE
72
- → uppercase lib
73
- → TRY sas-score-list-tables(lib.toUpperCase(), server="sas")
74
- IF tables found
75
- → success, return tables
76
- ELSE
77
- → inform user library not found in either server
78
- ```
79
-
80
- ---
81
-
82
- ## Common patterns
83
-
84
- **Pattern 1 — List tables, server unspecified**
85
- > "List tables in Public"
86
-
87
- 1. Try CAS: `sas-score-list-tables({ lib: "Public", server: "cas" })`
88
- 2. If empty, try SAS with uppercase: `sas-score-list-tables({ lib: "PUBLIC", server: "sas" })`
89
- 3. If still empty → inform user
90
-
91
- **Pattern 2 — List tables with explicit server (SAS)**
92
- > "List tables in sashelp in sas"
93
-
94
- 1. Skip server detection
95
- 2. Call with uppercase lib: `sas-score-list-tables({ lib: "SASHELP", server: "sas" })`
96
-
97
- **Pattern 3 — List tables with explicit server (CAS)**
98
- > "List tables in Public in cas"
99
-
100
- 1. No uppercase needed for CAS
101
- 2. Call: `sas-score-list-tables({ lib: "Public", server: "cas" })`
102
-
103
- **Pattern 4 — Pagination**
104
- > "Show me 25 tables in Samples, then the next batch"
105
-
106
- 1. First call: `sas-score-list-tables({ lib: "Samples", limit: 25, start: 1 })`
107
- 2. Next call: `sas-score-list-tables({ lib: "Samples", limit: 25, start: 26 })`
108
-
109
- **Pattern 5 — Library not found**
110
- > "List tables in foo"
111
-
112
- 1. Try CAS: empty
113
- 2. Try SAS with uppercase: empty
114
- 3. Response: *"The library 'foo' was not found in CAS or SAS. Please verify the library name."*
115
-
116
- ---
117
-
118
- ## Error handling
119
-
120
- | Scenario | Action |
121
- |---|---|
122
- | Library not found in either server | Inform user and ask to verify library name |
123
- | Empty result on first server | Automatically check second server |
124
- | User specifies invalid server | Return error; ask user to clarify: `"cas"` or `"sas"` |
125
- | Missing library name | Ask: *"Which library should I list tables from?"* |
126
- | Library verification needed | Use `sas-find-library-smart` skill to verify library exists first |
@@ -1,112 +0,0 @@
1
- ---
2
- name: sas-read-and-score
3
- description: >
4
- Guide the full read → score workflow in SAS Viya: reading records from a table and then scoring
5
- them with a MAS model (using sas-score-model-score). Use this skill whenever the user wants to score records
6
- from a table, run a model against query results, predict outcomes for a set of rows, or any
7
- combination of fetching data and scoring it. Trigger phrases include: "score these records",
8
- "score results of my query", "run the model on this table", "predict for these customers",
9
- "fetch and score", "read and score", "score rows from", "run model on table data", or any request
10
- that combines reading/querying table data with model prediction.
11
- ---
12
-
13
- # SAS Read → Score Workflow
14
-
15
- Orchestrates the full two-step pattern of reading records from a SAS/CAS table and scoring them
16
- with a deployed MAS model.
17
-
18
- ---
19
-
20
- ## Pre-flight verification
21
-
22
- **Before attempting to read or score table data:**
23
- 1. **Verify library exists**: Use `sas-find-resource-strategy` for library lookup (CAS first, then SAS if needed)
24
- 2. **Verify table exists**: Use `sas-find-resource-strategy` for table lookup in the selected library/server
25
- 3. **Verify model exists**: Use `sas-find-resource-strategy` for model lookup before scoring
26
- 4. **Confirm server location**: Ensure you know which server (CAS or SAS) contains the data
27
-
28
- This ensures consistent behavior with other data access operations.
29
-
30
- ---
31
-
32
- ## Workflow overview
33
-
34
- The typical flow involves:
35
- 1. **Fetch data** — Identify which table/query will provide input records
36
- 2. **Validate model** — Confirm the model exists and understand its input schema
37
- 3. **Score** — Invoke the model on the fetched records
38
- 4. **Present results** — Merge predictions with original data and display
39
-
40
- ---
41
-
42
- ## Scenario: User already has data
43
-
44
- 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
47
- - Invoke scoring
48
- - Return prediction
49
-
50
- ---
51
-
52
- ## Scenario: User wants to score table rows
53
-
54
- If the user specifies a table (e.g., "Score all customers in Public.customers with model X"):
55
- - Fetch raw rows (possibly filtered: "where status='active'")
56
- - Validate model compatibility with input columns
57
- - Invoke scoring on each row
58
- - Merge results with original data
59
- - Display combined table
60
-
61
- ---
62
-
63
- ## Scenario: User wants to score query results
64
-
65
- If the user wants to score aggregated/filtered results (e.g., "Score high-value customers (spend > 5000) with model X"):
66
- - Determine which records meet criteria (aggregation/filtering)
67
- - Validate model expects these input columns
68
- - Invoke scoring
69
- - Merge predictions with summary data
70
- - Display results
71
-
72
- ---
73
-
74
- ## Scenario: User unfamiliar with model
75
-
76
- If the user specifies a model name that's new/unknown:
77
- - Check if model exists
78
- - Retrieve model schema (inputs, outputs)
79
- - Show user what inputs the model expects
80
- - Confirm before proceeding with scoring
81
-
82
- ---
83
-
84
- ## Rules
85
-
86
- - Always validate table/library existence before attempting to read
87
- - Always check model exists before invoking `sas-score-model-score`
88
- - Match table columns to model input variables; warn on mismatch
89
- - If multiple records: score batch if possible; fall back to row-by-row
90
- - Merge predictions with original data using row index or key column
91
- - Present results as table with original columns + new prediction columns
92
-
93
- ---
94
-
95
- ## Error handling
96
-
97
- | Problem | Action |
98
- |---|---|
99
- | Table not found | Ask for correct lib.tablename |
100
- | Model not found | Inform user; suggest verifying model name |
101
- | Field/column mismatch | Show mismatch, ask user to confirm or adjust query |
102
- | Scoring error | Return structured error, suggest checking model inputs |
103
- | Empty read result | Inform user, ask if they want to adjust the query/filter |
104
- | Data type mismatch | Warn user about type conversion, proceed or ask for clarification |
105
-
106
- ---
107
-
108
- ## Integration with other skills
109
-
110
- - **Before this workflow**: Use `sas-find-library-smart` to verify the library exists
111
- - **For data retrieval**: Use `sas-read-strategy` to choose the right read tool (read-table vs sas-query)
112
- - **For scoring**: Use `sas-score-workflow` for advanced scoring options beyond MAS models
@@ -1,154 +0,0 @@
1
- ---
2
- name: sas-read-strategy
3
- description: >
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
- fetch records from a SAS/CAS table. Trigger phrases include: "read records from", "get data where",
7
- "fetch rows from", "query the table", "give me the first N records", "aggregate by", "join tables",
8
- or any request that starts with data retrieval.
9
- ---
10
-
11
- # SAS Read Strategy
12
-
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.
15
-
16
- ## Determine the server location
17
-
18
- Before retrieving data, locate the specific table first and determine which server(s) contain it:
19
-
20
- **Step 1: Locate the specific table (table-first)**
21
- - Use `sas-find-resource-strategy` to check if the table exists in CAS first, then SAS if needed
22
- - Do not perform a separate library-first lookup; table lookup already handles server-aware discovery
23
- - Possible outcomes:
24
- - If table exists **only in CAS** → set `server: "cas"`
25
- - If table exists **only in SAS** → set `server: "sas"`
26
- - If table exists **in both** → ask the user: *"The table exists in both CAS and SAS. Which server would you prefer to query from?"*
27
- - If table exists **in neither** → inform user and suggest verifying the table name
28
-
29
- ---
30
-
31
- ## Determine the read strategy
32
-
33
- Ask yourself: does the user already have the data in hand?
34
-
35
- - **Yes (user pasted values, or data is already in context)** → skip this strategy; data is ready to use.
36
- - **No** → choose the read tool based on intent:
37
-
38
- | User's Intent | Tool | Example |
39
- |---|---|---|
40
- | Get specific raw rows, apply simple filter, retrieve first N records | `sas-score-read-table` | "Show me 10 rows from customers where status='active'" |
41
- | Aggregate/summarize, calculate, join tables, analytical question | `sas-score-sas-query` | "Average salary by department", "Count orders by region" |
42
-
43
- ---
44
-
45
- ## Using read-table
46
-
47
- **When:**
48
- - User asks for raw records, row-by-row data
49
- - Simple WHERE filtering (e.g., "where status = 'active'")
50
- - Pagination needed ("first 50 rows", "next 10 rows")
51
-
52
- **How:**
53
- ```
54
- sas-score-read-table({
55
- table: "tablename",
56
- lib: "libraryname",
57
- server: "cas" or "sas", // determined from table-first lookup via sas-find-resource-strategy
58
- limit: N, // default 10, adjust based on user request
59
- where: "..." // optional SQL WHERE clause
60
- })
61
- ```
62
-
63
- **Rules:**
64
- - Always determine the server first using `sas-find-resource-strategy`
65
- - Keep batch size ≤ 50 rows unless the user explicitly requests more
66
- - If table name is missing, ask: *"Which table should I read from? (format: lib.tablename)"*
67
- - If library is missing, ask: *"Which library contains the table?"*
68
- - Prefer table-first lookup (CAS first, then SAS) instead of a separate library lookup step
69
- - If table exists in both servers, ask user which to use
70
- - Return raw column values; do not transform or aggregate
71
- - Do not use list tools to determine whether a resource exists
72
-
73
- ---
74
-
75
- ## Using sas-query
76
-
77
- **When:**
78
- - User asks for aggregation (SUM, AVG, COUNT, GROUP BY)
79
- - User asks for joins, calculations, or analytical insights
80
- - User's question is phrased analytically ("compare", "analyze", "breakdown", "trend")
81
-
82
- **How:**
83
- ```
84
- sas-query({
85
- table: "lib.tablename",
86
- query: "user's natural language question",
87
- sql: "SELECT ... FROM ... WHERE ... GROUP BY ..." // generated from query
88
- })
89
- ```
90
-
91
- **Rules:**
92
- - Check which server(s) contain the table using `sas-find-resource-strategy` first
93
- - If table exists in both CAS and SAS, ask user which to query from
94
- - Parse the user's natural language question into a PROC SQL SELECT statement
95
- - Ensure SELECT statement is valid SQL syntax
96
- - Do not add trailing semicolons to the SQL string
97
- - If table name is missing, ask: *"Which table should I query? (format: lib.tablename)"*
98
- - If the intent is unclear, ask for clarification: *"Do you want raw rows, or an aggregated summary?"*
99
-
100
- ---
101
-
102
- ## Common patterns
103
-
104
- **Pattern A — Raw row retrieval**
105
- > "Show me the first 5 rows from Public.customers"
106
-
107
- → `sas-score-read-table({ table: "customers", lib: "Public", limit: 5 })`
108
-
109
- **Pattern B — Filtered retrieval**
110
- > "Get all high-value orders (amount > 5000) from mylib.orders"
111
-
112
- → `sas-score-read-table({ table: "orders", lib: "mylib", where: "amount > 5000" })`
113
-
114
- **Pattern C — Aggregation**
115
- > "What is the average price by make in Public.cars?"
116
-
117
- → `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" })`
118
-
119
- **Pattern D — Join + analysis**
120
- > "Show me total sales by customer in the sales and customers tables"
121
-
122
- → `sas-score-sas-query()` with a JOIN in the generated SQL
123
-
124
- ---
125
-
126
- ## Error handling
127
-
128
- | Problem | Action |
129
- |---|---|
130
- | Library missing or unclear | Ask the user which library contains the table |
131
- | Table not found in either server | Inform user and suggest checking the table name |
132
- | Table exists in both CAS and SAS | Ask: *"The table exists in both servers. Which would you prefer: CAS or SAS?"* |
133
- | Table exists only in one server | Use that server automatically in your request |
134
- | Table name missing entirely | Ask: *"Which table should I read from?"* |
135
- | Ambiguous intent (raw vs aggregate) | Ask: *"Do you want individual rows or a summary by some field?"* |
136
- | Empty result | Inform user, ask to adjust filter or query |
137
-
138
- ---
139
-
140
- ## Integration with other skills
141
-
142
- - **Before this skill**: Use `sas-find-resource-strategy` for table-first resource lookup
143
- - **After this skill**: Use `sas-read-and-score` to score the retrieved data
144
-
145
- ---
146
-
147
- ## Next steps
148
-
149
- Once data is retrieved, typical follow-ups include:
150
- - **Visualize** — present as table or chart
151
- - **Export** — format and offer download
152
- - **Analyze further** — ask clarifying questions
153
- - **Score** — run predictions on the data
154
- - **Combine** — join with other datasets
@@ -1,69 +0,0 @@
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