@sassoftware/sas-score-mcp-serverjs 1.0.1-2 → 1.0.1-22

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.
@@ -0,0 +1,234 @@
1
+ ---
2
+ name: detail-strategy
3
+ description: >
4
+ Unified detail/information retrieval strategy. Handles MAS models, SCR models, and tables.
5
+ Always verify resources exist using find-resources skill before retrieving details.
6
+ ---
7
+
8
+ # Detail Strategy
9
+
10
+ Use this strategy when the user requests information about a resource: model details, schema, metadata, inputs/outputs, or any descriptive information.
11
+
12
+ ## Prerequisites
13
+
14
+ 1. Verify the resource exists using find-resources skill
15
+ 2. Determine resource type (MAS model, SCR model, or table)
16
+
17
+ ---
18
+
19
+ ## Step 1: Identify Resource Type
20
+
21
+ Classify the resource based on naming convention or context:
22
+
23
+ ```
24
+ model X.mas → MAS model (default for "model X")
25
+ model X.scr → SCR model
26
+ table X in library Y → CAS or SAS table
27
+ ```
28
+
29
+ ---
30
+
31
+ ## Step 2: Verify Resource Exists
32
+
33
+ Use find-resources skill to confirm resource exists before retrieval:
34
+
35
+ ### Find MAS Model
36
+ ```
37
+ find-resources skill → find-model
38
+ Tool: sas-score-find-model({ name: "<model>" })
39
+ ```
40
+
41
+ ### Find SCR Model
42
+ ```
43
+ find-resources skill → find-scr
44
+ Tool: sas-score-find-scr({ url: "<scr-endpoint>" })
45
+ ```
46
+
47
+ ### Find Table
48
+ ```
49
+ find-resources skill → find-table
50
+ Tool: sas-score-find-table({ lib: "<library>", name: "<table>", server: "<cas|sas>" })
51
+ ```
52
+
53
+ ---
54
+
55
+ ## Step 3: Get Details
56
+
57
+ ### Option A: MAS Model Details
58
+
59
+ **Trigger phrases**: "what inputs does model X need", "describe model X", "show variables for model X", "model X metadata", "model X information"
60
+
61
+ **Tool**: `sas-score-model-info`
62
+
63
+ **Parameters**:
64
+ ```
65
+ sas-score-model-info({
66
+ model: "<model name>"
67
+ })
68
+ ```
69
+
70
+ **Returns**:
71
+ - Input variables (name, type, role)
72
+ - Output variables (name, type, possible_values)
73
+ - Model type
74
+ - Description
75
+
76
+ **Example**:
77
+ ```
78
+ User: "What inputs does model churnRisk need?"
79
+
80
+ 1. Find: sas-score-find-model({ name: "churnRisk" })
81
+ 2. Get info: sas-score-model-info({ model: "churnRisk" })
82
+ 3. Return: { inputs: [...], outputs: [...], description: "..." }
83
+ ```
84
+
85
+ ---
86
+
87
+ ### Option B: SCR Model Details
88
+
89
+ **Trigger phrases**: "what does SCR model X need", "describe SCR model X", "SCR model X inputs", "SCR model X schema"
90
+
91
+ **Tool**: `sas-score-scr-info`
92
+
93
+ **Parameters**:
94
+ ```
95
+ sas-score-scr-info({
96
+ url: "<scr endpoint>"
97
+ })
98
+ ```
99
+
100
+ **Returns**:
101
+ - Input schema (variable names, types, required/optional)
102
+ - Output schema (prediction, probabilities, scores)
103
+ - Model metadata
104
+
105
+ **Example**:
106
+ ```
107
+ User: "Show inputs for SCR model at https://scr-host/models/loan"
108
+
109
+ 1. Get info: sas-score-scr-info({ url: "https://scr-host/models/loan" })
110
+ 2. Return: { inputs: [...], outputs: [...] }
111
+ ```
112
+
113
+ **Note**: SCR models typically do not require pre-verification (can call scr-info directly)
114
+
115
+ ---
116
+
117
+ ### Option C: Table Details
118
+
119
+ **Trigger phrases**: "what columns in table X", "describe table X", "show schema for table X", "table X structure", "table X metadata"
120
+
121
+ **Tool**: `sas-score-table-info`
122
+
123
+ **Parameters**:
124
+ ```
125
+ sas-score-table-info({
126
+ lib: "<library>",
127
+ table: "<table name>",
128
+ server: "<cas|sas>"
129
+ })
130
+ ```
131
+
132
+ **Returns**:
133
+ - Columns array (name, type, label, format, length)
134
+ - Table info (rowCount, fileSize, created, modified)
135
+
136
+ **Example**:
137
+ ```
138
+ User: "What columns are in the customers table in Public?"
139
+
140
+ 1. Find: sas-score-find-table({ lib: "Public", name: "customers", server: "cas" })
141
+ 2. Get info: sas-score-table-info({ lib: "Public", table: "customers", server: "cas" })
142
+ 3. Return: { columns: [...], tableInfo: {...} }
143
+ ```
144
+
145
+ ---
146
+
147
+ ## Decision Tree
148
+
149
+ ```
150
+ User requests information/details
151
+ ├─ About a MAS model?
152
+ │ → Find model (find-resources)
153
+ │ → Call: sas-score-model-info
154
+
155
+ ├─ About a SCR model?
156
+ │ → Call: sas-score-scr-info (can skip verification)
157
+
158
+ └─ About a table?
159
+ → Find table (find-resources, determine server)
160
+ → Call: sas-score-table-info
161
+ ```
162
+
163
+ ---
164
+
165
+ ## Implementation Checklist
166
+
167
+ For each detail/information request:
168
+
169
+ - [ ] **Classify** resource type (MAS/SCR/table)
170
+ - [ ] **Verify** resource exists (use find-resources skill, except SCR)
171
+ - [ ] **Determine** server for tables (CAS or SAS)
172
+ - [ ] **Execute** appropriate detail tool
173
+ - [ ] **Format** results (column alignment, readable structure)
174
+ - [ ] **Append** Strategy Summary to response
175
+
176
+ ---
177
+
178
+ ## Response Format
179
+
180
+ Always append a **Strategy Summary** to responses:
181
+
182
+ ```
183
+ ---
184
+
185
+ **Strategy Summary:**
186
+ - **Classification**: [Resource type identified]
187
+ - **Verification**: [Resource found or skipped (SCR)]
188
+ - **Tool Used**: [Detail tool invoked]
189
+ - **Server**: [CAS/SAS for tables, N/A for models]
190
+ ```
191
+
192
+ ---
193
+
194
+ ## Error Recovery
195
+
196
+ If a request fails:
197
+
198
+ 1. **Resource not found** → Ask user to verify name/spelling
199
+ 2. **Server mismatch** → Re-verify server location with find-resources
200
+ 3. **Invalid URL (SCR)** → Ask for correct SCR endpoint URL
201
+ 4. **Tool error** → Return error message verbatim and ask for clarification
202
+
203
+ ---
204
+
205
+ ## Examples
206
+
207
+ ### Example 1: Model Information
208
+
209
+ **User**: "Describe model creditScore"
210
+
211
+ **Workflow**:
212
+ 1. Classify: MAS model detail request
213
+ 2. Verify: Find model creditScore → Found ✓
214
+ 3. Execute: `sas-score-model-info({ model: "creditScore" })`
215
+ 4. Return: Model inputs, outputs, and description
216
+
217
+ ### Example 2: SCR Model Schema
218
+
219
+ **User**: "What inputs does the SCR loan model need?"
220
+
221
+ **Workflow**:
222
+ 1. Classify: SCR model detail request
223
+ 2. Execute: `sas-score-scr-info({ url: "https://scr-host/models/loan" })`
224
+ 3. Return: Input schema and output schema
225
+
226
+ ### Example 3: Table Columns
227
+
228
+ **User**: "Show columns for customers in Public"
229
+
230
+ **Workflow**:
231
+ 1. Classify: Table detail request
232
+ 2. Verify: Find table customers in Public → CAS ✓
233
+ 3. Execute: `sas-score-table-info({ lib: "Public", table: "customers", server: "cas" })`
234
+ 4. Return: Column names, types, and table metadata
@@ -0,0 +1,152 @@
1
+ ---
2
+ name: find-resources
3
+ description: >
4
+ Unified resource verification skill. Use the appropriate find tool before any execution.
5
+ Determines server for tables (CAS vs SAS). Never use list tools for finding; list tools are for discovery only.
6
+ ---
7
+
8
+ # Unified Resource Finding Strategy
9
+
10
+ Use this strategy to verify that a resource exists before executing any action.
11
+
12
+ Do **not** use list tools for finding specific resources. List tools are for listing available resources and exploration, not verification.
13
+
14
+ ## Resource Types and Find Tools
15
+
16
+ ### 1. Find Library
17
+
18
+ **Trigger**: "find library X", "does library X exist", "check if library X", "locate library X"
19
+
20
+ **Tool**: `sas-score-find-library`
21
+
22
+ **Logic**:
23
+ - If server is specified: Use that server directly
24
+ - If server is not specified:
25
+ 1. Try CAS first: `sas-score-find-library({ name: "<lib>", server: "cas" })`
26
+ 2. If not found, uppercase Lib and try SAS with uppercase name: `sas-score-find-library({ name: "<LIB>", server: "sas" })`
27
+ 3. Report which server (or not found in either)
28
+
29
+ **Known default libraries**:
30
+ - CAS: Casuser, Formats, ModelPerformanceData, Models, Public, Samples, SystemData
31
+ - SAS: MAPS, MAPSGFK, MAPSSAS, SASDQREF, SASHELP, SASUSER, WORK
32
+
33
+ ---
34
+
35
+ ### 2. Find Table
36
+
37
+ **Trigger**: "find table X", "does table X exist in Y", "locate table X in library Y"
38
+
39
+ **Tool**: `sas-score-find-table`
40
+
41
+ **Required inputs**:
42
+ - Library name
43
+ - Table name
44
+ - Server (determined from library context or user specification)
45
+
46
+ **Logic**:
47
+ - If you already know that the table exists in a specific server return that result directly,
48
+ otherwise follow these steps:
49
+ 1. If library is a known CAS library (Casuser, Public, Samples, etc.), use cas as server
50
+ 2. If library is a known SAS library (SASHELP, WORK, SASUUSER, etc.), use sas as server
51
+ 3. If the server has been identified in an earlier step for this library, use that as the server
52
+
53
+ 4. If server is known at this point:
54
+ 1. if server is sas, uppercase library name and try: `sas-score-find-table({ lib: "<LIB>", name: "<table>", server: "sas" })`
55
+ 2.find the table: `sas-score-find-table({ lib: "<library>", name: "<table>", server: "<server" });`
56
+ 5. If server is not known
57
+ 1. Try CAS first: `sas-score-find-table({ lib: "<library>", name: "<table>", server: "cas" })`
58
+ 2. If not found, uppercase Lib and try SAS: `sas-score-find-table({ lib: "<LIBRARY>", name: "<table>", server: "sas" })`
59
+ 6. If the table was found report success and server.
60
+ 7. If not found, report failure.
61
+
62
+ **Output**: Table server location (CAS or SAS)
63
+
64
+ ---
65
+
66
+ ### 3. Find MAS Model
67
+
68
+ **Trigger**: "find model X", "does model X exist", "locate model X"
69
+
70
+ **Tool**: `sas-score-find-model`
71
+
72
+ **Logic**: Strip `.mas` suffix if present, use base name
73
+ - `sas-score-find-model({ name: "<model>" })`
74
+
75
+ ---
76
+
77
+ ### 4. Find Job
78
+
79
+ **Trigger**: "find job X", "does job X exist", "locate job X"
80
+
81
+ **Tool**: `sas-score-find-job`
82
+
83
+ **Logic**:
84
+ - `sas-score-find-job({ name: "<job>" })`
85
+
86
+ ---
87
+
88
+ ### 5. Find JobDef
89
+
90
+ **Trigger**: "find jobdef X", "does jobdef X exist", "locate jobdef X"
91
+
92
+ **Tool**: `sas-score-find-jobdef`
93
+
94
+ **Logic**:
95
+ - `sas-score-find-jobdef({ name: "<jobdef>" })`
96
+
97
+ ---
98
+
99
+ ### 6. Find SCR Model
100
+
101
+ **Trigger**: "find scr model X", "does scr model X exist"
102
+
103
+ **Action**: Ask user for the SCR URL/endpoint. SCR models do not have a pre-verification tool.
104
+
105
+
106
+ ---
107
+
108
+
109
+
110
+ ## Generic Model Type Inference
111
+
112
+ If user says "find model X" without a type suffix, infer the type:
113
+
114
+ | Suffix | Type | Find Tool |
115
+ |---|---|---|
116
+ | `.mas` | MAS model | `sas-score-find-model` |
117
+ | `.job` | SAS Job | `sas-score-find-job` |
118
+ | `.jobdef` | SAS JobDef | `sas-score-find-jobdef` |
119
+ | `.scr` | SCR model | Skip (no find) |
120
+ | (none) | Default to MAS | `sas-score-find-model` |
121
+
122
+ ---
123
+
124
+ ## Clarifying Questions
125
+
126
+ If required information is missing:
127
+ - "Which library contains the table?" (if table lookup missing library)
128
+ - "Which server? (CAS or SAS)" (if ambiguous and not a known default)
129
+ - "Is this a MAS model, Job, or JobDef?" (if model type ambiguous)
130
+
131
+ ---
132
+
133
+ ## Output Format
134
+
135
+ For **found** resources:
136
+ - Confirm exact resource name from tool result
137
+ - Confirm server (for CAS/SAS resources)
138
+ - Example: "Found table customers in Public library (CAS)"
139
+
140
+ For **not found** resources:
141
+ - State clearly: "Table xyz not found in library ABC on either CAS or SAS"
142
+ - Ask for verification or correction
143
+
144
+ ---
145
+
146
+ ## Error Handling
147
+
148
+ If tool returns empty or error:
149
+ 1. Confirm the resource name spelling with user
150
+ 2. For tables: Confirm library name and server
151
+ 3. For models: Ask whether MAS, Job, or JobDef
152
+ 4. Ask user to verify resource exists on the server
@@ -0,0 +1,245 @@
1
+ ---
2
+ name: list-resource
3
+ description: >
4
+ Unified resource listing strategy. Use appropriate list tools for discovery and browsing.
5
+ Determines pagination parameters. Use list tools for discovery only; use find tools for verification.
6
+ ---
7
+
8
+ # Unified Resource Listing Strategy
9
+
10
+ Use this strategy to discover and browse available resources (libraries, tables, models, jobs, jobdefs).
11
+
12
+ ## Resource Types and List Tools
13
+
14
+ ### 1. List Libraries
15
+
16
+ **Trigger**: "list libraries", "show all libs", "list available libraries", "browse libraries"
17
+
18
+ **Tool**: `sas-score-list-libraries`
19
+
20
+ **Logic**:
21
+ - If server is specified: List from that server only
22
+ - If server is not specified: List from all servers (default)
23
+
24
+ **Parameters**:
25
+ ```
26
+ server: "cas" | "sas" | "all" # "cas" = CAS only, "sas" = SAS only, "all" = both
27
+ start: <offset> # 1-based page number (default 1)
28
+ limit: <page size> # items per page (default 10, max varies)
29
+ where: "<filter expression>" # optional filter
30
+ ```
31
+
32
+ **Examples**:
33
+ ```
34
+ # List all CAS libraries
35
+ sas-score-list-libraries({ server: "cas", start: 1, limit: 10 })
36
+
37
+ # List SAS libraries
38
+ sas-score-list-libraries({ server: "sas", start: 1, limit: 10 })
39
+
40
+ # List all libraries
41
+ sas-score-list-libraries({ server: "all", start: 1, limit: 10 })
42
+
43
+ # Pagination: show next page
44
+ sas-score-list-libraries({ server: "all", start: 11, limit: 10 })
45
+ ```
46
+
47
+ ---
48
+
49
+ ### 2. List Tables in Library
50
+
51
+ **Trigger**: "list tables in X", "show tables in library X", "browse tables in X", "what tables are in X"
52
+
53
+ **Tool**: `sas-score-list-tables`
54
+
55
+ **Required inputs**:
56
+ - Library name
57
+ - Server (determined from library context or user specification)
58
+
59
+ **Logic**:
60
+ - If library is a known CAS library (Casuser, Public, Samples, etc.), use CAS
61
+ - If library is a known SAS library (SASHELP, WORK, SASUUSER, etc.), use SAS
62
+ - If ambiguous: Ask user or try both
63
+
64
+ **Parameters**:
65
+ ```
66
+ lib: "<library>" # Required: library name
67
+ server: "cas" or "sas" # Determined from library
68
+ start: <offset> # 1-based page number (default 1)
69
+ limit: <page size> # items per page (default 10)
70
+ where: "<filter expression>" # optional filter
71
+ ```
72
+
73
+ **Examples**:
74
+ ```
75
+ # List tables in Public (CAS)
76
+ sas-score-list-tables({ lib: "Public", server: "cas", start: 1, limit: 10 })
77
+
78
+ # List tables in SASHELP (SAS)
79
+ sas-score-list-tables({ lib: "SASHELP", server: "sas", start: 1, limit: 10 })
80
+
81
+ # Pagination: show next page
82
+ sas-score-list-tables({ lib: "Public", server: "cas", start: 11, limit: 10 })
83
+ ```
84
+
85
+ ---
86
+
87
+ ### 3. List Models
88
+
89
+ **Trigger**: "list models", "show all models", "browse models", "what models are available"
90
+
91
+ **Tool**: `sas-score-list-models`
92
+
93
+ **Logic**: Lists all models published to the Model Administration Service (MAS).
94
+ - No server selection required (MAS is centralized)
95
+
96
+ **Parameters**:
97
+ ```
98
+ start: <offset> # 1-based page number (default 1)
99
+ limit: <size> # items per page (default 10)
100
+ ```
101
+
102
+ **Examples**:
103
+ ```
104
+ # List first 10 models
105
+ sas-score-list-models({ start: 1, limit: 10 })
106
+
107
+ # List 25 models
108
+ sas-score-list-models({ start: 1, limit: 25 })
109
+
110
+ # Pagination: show next page
111
+ sas-score-list-models({ start: 11, limit: 10 })
112
+ ```
113
+
114
+ ---
115
+
116
+ ### 4. List Jobs
117
+
118
+ **Trigger**: "list jobs", "show all jobs", "browse jobs", "what jobs are available"
119
+
120
+ **Tool**: `sas-score-list-jobs`
121
+
122
+ **Logic**: Lists all SAS Viya job assets.
123
+
124
+ **Parameters**:
125
+ ```
126
+ start: <offset> # 1-based page number (default 1)
127
+ limit: <page size> # items per page (default 10)
128
+ where: "<filter expression>" # optional filter
129
+ ```
130
+
131
+ **Examples**:
132
+ ```
133
+ # List first 10 jobs
134
+ sas-score-list-jobs({ start: 1, limit: 10 })
135
+
136
+ # List 25 jobs
137
+ sas-score-list-jobs({ start: 1, limit: 25 })
138
+
139
+ # Pagination: show next page
140
+ sas-score-list-jobs({ start: 11, limit: 10 })
141
+ ```
142
+
143
+ ---
144
+
145
+ ### 5. List JobDefs
146
+
147
+ **Trigger**: "list jobdefs", "show all jobdefs", "browse jobdefs", "what jobdefs are available"
148
+
149
+ **Tool**: `sas-score-list-jobdefs`
150
+
151
+ **Logic**: Lists all SAS Viya job definition assets.
152
+
153
+ **Parameters**:
154
+ ```
155
+ start: <offset> # 1-based page number (default 1)
156
+ limit: <page size> # items per page (default 10)
157
+ where: "<filter expression>" # optional filter
158
+ ```
159
+
160
+ **Examples**:
161
+ ```
162
+ # List first 10 jobdefs
163
+ sas-score-list-jobdefs({ start: 1, limit: 10 })
164
+
165
+ # List 25 jobdefs
166
+ sas-score-list-jobdefs({ start: 1, limit: 25 })
167
+
168
+ # Pagination: show next page
169
+ sas-score-list-jobdefs({ start: 11, limit: 10 })
170
+ ```
171
+
172
+ ---
173
+
174
+ ## Pagination Strategy
175
+
176
+ All list operations support pagination via `start` and `limit` parameters:
177
+
178
+ | Parameter | Type | Default | Notes |
179
+ |---|---|---|---|
180
+ | `start` | number | 1 | 1-based page offset |
181
+ | `limit` | number | 10 | items per page |
182
+
183
+ **Pagination Detection**:
184
+ ```
185
+ If returned items < limit
186
+ → End of list reached
187
+ Else if returned items === limit
188
+ → Hint: More items available. Next start = start + limit
189
+ ```
190
+
191
+ **Example**:
192
+ ```
193
+ List 1: start=1, limit=10 → returns 10 items
194
+ List 2: start=11, limit=10 → returns 10 items
195
+ List 3: start=21, limit=10 → returns 5 items (< limit)
196
+ → End of list (total: 25 items)
197
+ ```
198
+
199
+ ---
200
+
201
+ ## Decision Tree
202
+
203
+ ```
204
+ User requests to list/browse resources
205
+
206
+ What resource type?
207
+ ├─ Libraries? → Use sas-score-list-libraries
208
+ ├─ Tables in library X? → Use sas-score-list-tables
209
+ ├─ Models? → Use sas-score-list-models
210
+ ├─ Jobs? → Use sas-score-list-jobs
211
+ └─ JobDefs? → Use sas-score-list-jobdefs
212
+ ```
213
+
214
+ ---
215
+
216
+ ## Known Default Libraries
217
+
218
+ ### CAS Libraries (server: "cas")
219
+ - Casuser
220
+ - Formats
221
+ - ModelPerformanceData
222
+ - Models
223
+ - Public
224
+ - Samples
225
+ - SystemData
226
+
227
+ ### SAS Libraries (server: "sas")
228
+ - MAPS
229
+ - MAPSGFK
230
+ - MAPSSAS
231
+ - SASDQREF
232
+ - SASHELP
233
+ - SASUSER
234
+ - WORK
235
+
236
+ ---
237
+
238
+ ## Differences: Find vs List
239
+
240
+ | Aspect | Find | List |
241
+ |---|---|---|
242
+ | Purpose | Verify existence | Browse/discover |
243
+ | Returns | Single resource or not found | Multiple resources with pagination |
244
+ | Use case | Before execution | Exploration/discovery |
245
+ | Tool suffix | `find-*` | `list-*` |