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

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 (96) hide show
  1. package/.skills/agents/sas-score-mcp-serverjs-agent.md +190 -0
  2. package/.skills/copilot-instructions.md +241 -0
  3. package/.skills/skills/README.md +125 -0
  4. package/.skills/skills/detail-strategy/SKILL.md +272 -0
  5. package/.skills/skills/find-resources/SKILL.md +155 -0
  6. package/.skills/skills/list-resource/SKILL.md +258 -0
  7. package/.skills/skills/read-strategy/SKILL.md +137 -0
  8. package/.skills/skills/request-routing/SKILL.md +107 -0
  9. package/.skills/skills/score-strategy/SKILL.md +231 -0
  10. package/README.md +96 -54
  11. package/cli.js +37 -27
  12. package/openApi.yaml +121 -121
  13. package/package.json +14 -14
  14. package/scripts/docs/oauth-http-transport.md +2 -2
  15. package/scripts/refreshtoken.js +58 -0
  16. package/src/createMcpServer.js +0 -1
  17. package/src/expressMcpServer.js +47 -49
  18. package/src/oauthHandlers/authorize.js +4 -1
  19. package/src/oauthHandlers/baseUrl.js +4 -0
  20. package/src/oauthHandlers/callback.js +5 -1
  21. package/src/oauthHandlers/getMetadata.js +4 -0
  22. package/src/oauthHandlers/index.js +4 -0
  23. package/src/oauthHandlers/token.js +4 -0
  24. package/src/openApi.yaml +121 -121
  25. package/src/processHeaders.js +10 -7
  26. package/src/setupSkills.js +12 -7
  27. package/src/toolHelpers/_findJob.js +12 -0
  28. package/src/toolHelpers/_findJobdef.js +10 -0
  29. package/src/toolHelpers/_findLibrary.js +10 -0
  30. package/src/toolHelpers/_findModel.js +12 -0
  31. package/src/toolHelpers/_findTable.js +10 -0
  32. package/src/toolHelpers/_listJobs.js +2 -1
  33. package/src/toolHelpers/_listLibrary.js +1 -1
  34. package/src/toolHelpers/_listTables.js +1 -1
  35. package/src/toolHelpers/getLogonPayload.js +2 -2
  36. package/src/toolSet/devaScore.js +61 -61
  37. package/src/toolSet/findJob.js +2 -1
  38. package/src/toolSet/findJobdef.js +7 -7
  39. package/src/toolSet/findLibrary.js +68 -68
  40. package/src/toolSet/findModel.js +2 -2
  41. package/src/toolSet/findTable.js +2 -2
  42. package/src/toolSet/jobInfo.js +59 -0
  43. package/src/toolSet/jobdefInfo.js +59 -0
  44. package/src/toolSet/listJobdefs.js +61 -61
  45. package/src/toolSet/listJobs.js +61 -61
  46. package/src/toolSet/listLibraries.js +78 -78
  47. package/src/toolSet/listModels.js +56 -56
  48. package/src/toolSet/listTables.js +66 -66
  49. package/src/toolSet/makeTools.js +3 -0
  50. package/src/toolSet/modelInfo.js +1 -1
  51. package/src/toolSet/modelScore.js +23 -25
  52. package/src/toolSet/readTable.js +63 -63
  53. package/src/toolSet/runCasProgram.js +21 -10
  54. package/src/toolSet/runJob.js +15 -19
  55. package/src/toolSet/runJobdef.js +15 -19
  56. package/src/toolSet/runMacro.js +82 -82
  57. package/src/toolSet/sasQuery.js +77 -77
  58. package/src/toolSet/scrScore.js +60 -69
  59. package/src/toolSet/setContext.js +65 -65
  60. package/src/toolSet/superstat.js +61 -61
  61. package/src/toolSet/tableInfo.js +58 -58
  62. package/.skills_claude/README.md +0 -303
  63. package/.skills_claude/TESTING_GUIDE.md +0 -252
  64. package/.skills_claude/agents/sas-viya-scoring-expert.md +0 -58
  65. package/.skills_claude/claude-desktop-config.json +0 -16
  66. package/.skills_claude/claude-desktop-system-prompt.md +0 -127
  67. package/.skills_claude/copilot-instructions.md +0 -155
  68. package/.skills_claude/instructions.md +0 -184
  69. package/.skills_claude/skills/sas-find-library-smart/SKILL.md +0 -157
  70. package/.skills_claude/skills/sas-find-resource-strategy/SKILL.md +0 -105
  71. package/.skills_claude/skills/sas-list-resource-strategy/SKILL.md +0 -124
  72. package/.skills_claude/skills/sas-list-tables-smart/SKILL.md +0 -126
  73. package/.skills_claude/skills/sas-read-and-score/SKILL.md +0 -112
  74. package/.skills_claude/skills/sas-read-strategy/SKILL.md +0 -154
  75. package/.skills_claude/skills/sas-request-classifier/SKILL.md +0 -69
  76. package/.skills_claude/skills/sas-score-workflow/SKILL.md +0 -200
  77. package/.skills_claude/skills-index.md +0 -345
  78. package/.skills_github/agents/sas-viya-scoring-expert.md +0 -58
  79. package/.skills_github/copilot-instructions.md +0 -177
  80. package/.skills_github/skills/sas-find-library-smart/SKILL.md +0 -155
  81. package/.skills_github/skills/sas-find-resource-strategy/SKILL.md +0 -105
  82. package/.skills_github/skills/sas-list-resource-strategy/SKILL.md +0 -124
  83. package/.skills_github/skills/sas-list-tables-smart/SKILL.md +0 -128
  84. package/.skills_github/skills/sas-read-and-score/SKILL.md +0 -113
  85. package/.skills_github/skills/sas-read-strategy/SKILL.md +0 -154
  86. package/.skills_github/skills/sas-request-classifier/SKILL.md +0 -74
  87. package/.skills_github/skills/sas-score-workflow/SKILL.md +0 -314
  88. package/scripts/optimize_final.py +0 -140
  89. package/scripts/optimize_tools.py +0 -99
  90. package/scripts/setup-skills.js +0 -34
  91. package/scripts/update_descriptions.py +0 -46
  92. package/src/authpkce.js +0 -219
  93. package/src/handleGetDelete.js +0 -34
  94. package/src/handleRequest.js +0 -112
  95. package/src/hapiMcpServer.js +0 -241
  96. package/src/toolSet/.claude/settings.local.json +0 -13
@@ -0,0 +1,272 @@
1
+ ---
2
+ name: detail-strategy
3
+ description: >
4
+ Unified detail/information/describe retrieval strategy. Handles MAS models, Job models, JobDef models, SCR models, and tables. Verify resources exist using find-resources skill before retrieving details (except SCR models, which can be queried directly).
5
+ ---
6
+
7
+ # Detail Strategy
8
+
9
+ Use this strategy when the user requests information about a resource.
10
+
11
+ **Supported resource types**: MAS model, Job model, JobDef model, SCR model, or table.
12
+
13
+ If the specified resource is ambiguous, ask the user for clarification (e.g. "Are you asking about a MAS model, a Job model, a JobDef model, a SCR model or a table?").
14
+
15
+ Verification vs Retrieval (simplified)
16
+
17
+ - We separate the workflow into two clear, sequential phases to reduce branching and cognitive load:
18
+ 1. Verification phase — confirm the resource exists and determine its exact type and server. Use the appropriate "find" tool for all resource types except SCR models.
19
+ 2. Retrieval phase — after successful verification, call the detail/read tool appropriate for the identified resource type to fetch metadata or content.
20
+
21
+ - Exception for SCR models: document the exception inline — SCR models may be queried directly with `sas-score-scr-info` when the user provides a specific SCR endpoint. Even when skipping verification, still validate the endpoint/URL format before calling the tool.
22
+
23
+ Apply this separation consistently across MAS models, Job models, JobDef models, SCR models, and tables.
24
+
25
+ ---
26
+
27
+ ## Classification & Verification Process
28
+
29
+ ### Phase 1: Classify the Resource Type
30
+
31
+ Determine resource type from context/naming conventions:
32
+
33
+ | Pattern | Resource Type |
34
+ |--------------------------|---------------|
35
+ | model X (or X.mas) | MAS model |
36
+ | model X.scr | SCR model |
37
+ | model X.job | Job model |
38
+ | model X.jobdef | JobDef model |
39
+ | table X in library Y | Table |
40
+
41
+ If resource is ambiguous, ask user for clarification.
42
+
43
+ ### Phase 2: Verify Resource Exists (Skip for SCR Models)
44
+
45
+ For each resource type, use the appropriate verification tool:
46
+
47
+ | Resource Type | Tool |
48
+ |---------------|-------------------|
49
+ | MAS model | sas-score-find-model |
50
+ | Job model | sas-score-find-job |
51
+ | JobDef model | sas-score-find-jobdef |
52
+ | Table | sas-score-find-table |
53
+ | SCR model | *(no verification needed)* |
54
+
55
+ If verification fails, inform the user and ask for additional details or corrections.
56
+
57
+ ---
58
+
59
+ ## Detail Retrieval Process
60
+
61
+ ### Phase 3: Get Details
62
+
63
+ ### Option A: MAS Model Details
64
+
65
+ **Trigger phrases**: "what inputs does model X need", "describe model X", "show variables for model X", "model X metadata", "model X information"
66
+
67
+ **Tool**: `sas-score-model-info`
68
+
69
+ **Parameters**:
70
+ ```
71
+ sas-score-model-info({
72
+ model: "<model name>"
73
+ })
74
+ ```
75
+
76
+ **Returns**:
77
+ - Input variables (name, type, role)
78
+ - Output variables (name, type, possible_values)
79
+ - Model type
80
+ - Description
81
+
82
+ **Example**:
83
+ ```
84
+ User: "What inputs does model churnRisk need?"
85
+
86
+ 1. Find: sas-score-find-model({ name: "churnRisk" })
87
+ 2. Get info: sas-score-model-info({ model: "churnRisk" })
88
+ 3. Return: { inputs: [...], outputs: [...], description: "..." }
89
+ ```
90
+
91
+ ---
92
+
93
+ ### Option B: SCR Model Details
94
+
95
+ **Trigger phrases**: "what does SCR model X need", "describe SCR model X", "SCR model X inputs", "SCR model X schema"
96
+
97
+ **Tool**: `sas-score-scr-info`
98
+
99
+ **Parameters**:
100
+ ```
101
+ sas-score-scr-info({
102
+ url: "<scr endpoint>"
103
+ })
104
+ ```
105
+
106
+ **Returns**:
107
+ - Input schema (variable names, types, required/optional)
108
+ - Output schema (prediction, probabilities, scores)
109
+ - Model metadata
110
+
111
+ **Example**:
112
+ ```
113
+ User: "Show inputs for SCR model at https://scr-host/models/loan"
114
+
115
+ 1. Get info: sas-score-scr-info({ url: "https://scr-host/models/loan" })
116
+ 2. Return: { inputs: [...], outputs: [...] }
117
+ ```
118
+
119
+ **Note**: SCR models typically do not require pre-verification (can call scr-info directly)
120
+
121
+ ---
122
+
123
+ ### Option C: Table Details
124
+
125
+ **Trigger phrases**: "what columns in table X", "describe table X", "show schema for table X", "table X structure", "table X metadata"
126
+
127
+ **Tool**: `sas-score-table-info`
128
+
129
+ **Parameters**:
130
+ ```
131
+ sas-score-table-info({
132
+ lib: "<library>",
133
+ table: "<table name>",
134
+ server: "<cas|sas>"
135
+ })
136
+ ```
137
+
138
+ **Returns**:
139
+ - Columns array (name, type, label, format, length)
140
+ - Table info (rowCount, fileSize, created, modified)
141
+
142
+ **Example**:
143
+ ```
144
+ User: "What columns are in the customers table in Public?"
145
+
146
+ 1. Find: sas-score-find-table({ lib: "Public", name: "customers", server: "cas" })
147
+ 2. Get info: sas-score-table-info({ lib: "Public", table: "customers", server: "cas" })
148
+ 3. Return: { columns: [...], tableInfo: {...} }
149
+ ```
150
+
151
+ ---
152
+ ### Option D: Job Model Details
153
+
154
+ **Trigger phrases**: "what inputs does job model X need", "describe job model X", "show variables for job model X", "job model X metadata", "job model X information"
155
+
156
+ **Tool**: `sas-score-job-info`
157
+
158
+ **Parameters**:
159
+ ```
160
+ sas-score-job-info({
161
+ model: "<model name>"
162
+ })
163
+ ```
164
+
165
+ **Returns**:
166
+ - Input variables (name, type, role)
167
+
168
+ **Example**:
169
+ ```
170
+ User: "What inputs does job model churnRisk need?"
171
+
172
+ 1. Find: sas-score-find-job({ name: "churnRisk" })
173
+ 2. Get info: sas-score-job-info({ model: "churnRisk" })
174
+ 3. Return: { inputs: [...] }
175
+ ```
176
+
177
+ ## Decision Tree
178
+
179
+ ```
180
+ User requests information/details
181
+ ├─ About a MAS model?
182
+ │ → Verify: sas-score-find-model
183
+ │ → Call: sas-score-model-info
184
+
185
+ ├─ About a SCR model?
186
+ │ → Call: sas-score-scr-info (skip verification; validate URL first)
187
+
188
+ ├─ About a Job model?
189
+ │ → Verify: sas-score-find-job
190
+ │ → Call: sas-score-job-info
191
+
192
+ ├─ About a JobDef model?
193
+ │ → Verify: sas-score-find-jobdef
194
+ │ → Call: sas-score-job-info
195
+
196
+ └─ About a table?
197
+ → Verify: sas-score-find-table (determine CAS or SAS server)
198
+ → Call: sas-score-table-info
199
+ ```
200
+
201
+ ---
202
+
203
+ ## Implementation Checklist
204
+
205
+ For each detail/information request:
206
+
207
+ - [ ] **Classify** resource type (MAS / Job / JobDef / SCR / table)
208
+ - [ ] **Verify** resource exists (use find-resources skill, except SCR)
209
+ - [ ] **Determine** server for tables (CAS or SAS)
210
+ - [ ] **Execute** appropriate detail tool
211
+ - [ ] **Format** results (column alignment, readable structure)
212
+ - [ ] **Append** Strategy Summary to response
213
+
214
+ ---
215
+
216
+ ## Response Format
217
+
218
+ Always append a **Strategy Summary** to responses:
219
+
220
+ ```
221
+ ---
222
+
223
+ **Strategy Summary:**
224
+ - **Classification**: [Resource type identified]
225
+ - **Verification**: [Resource found or skipped (SCR)]
226
+ - **Tool Used**: [Detail tool invoked]
227
+ - **Server**: [CAS/SAS for tables, N/A for models]
228
+ ```
229
+
230
+ ---
231
+
232
+ ## Error Recovery
233
+
234
+ If a request fails:
235
+
236
+ 1. **Resource not found** → Ask user to verify name/spelling
237
+ 2. **Server mismatch** → Re-verify server location with find-resources
238
+ 3. **Invalid URL (SCR)** → Ask for correct SCR endpoint URL
239
+ 4. **Tool error** → Return error message verbatim and ask for clarification
240
+
241
+ ---
242
+
243
+ ## Examples
244
+
245
+ ### Example 1: Model Information
246
+
247
+ **User**: "Describe model creditScore"
248
+
249
+ **Workflow**:
250
+ 1. Classify: MAS model detail request
251
+ 2. Verify: Find model creditScore → Found ✓
252
+ 3. Execute: `sas-score-model-info({ model: "creditScore" })`
253
+ 4. Return: Model inputs, outputs, and description
254
+
255
+ ### Example 2: SCR Model Schema
256
+
257
+ **User**: "What inputs does the SCR loan model need?"
258
+
259
+ **Workflow**:
260
+ 1. Classify: SCR model detail request
261
+ 2. Execute: `sas-score-scr-info({ url: "https://scr-host/models/loan" })`
262
+ 3. Return: Input schema and output schema
263
+
264
+ ### Example 3: Table Columns
265
+
266
+ **User**: "Show columns for customers in Public"
267
+
268
+ **Workflow**:
269
+ 1. Classify: Table detail request
270
+ 2. Verify: Find table customers in Public → CAS ✓
271
+ 3. Execute: `sas-score-table-info({ lib: "Public", table: "customers", server: "cas" })`
272
+ 4. Return: Column names, types, and table metadata
@@ -0,0 +1,155 @@
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 verifying or finding specific resources; list tools are for discovery and exploration 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 verifying or finding specific resources. List tools are for discovery and exploration only, not for confirming the existence of a specific resource.
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
+
23
+ **Logic**:
24
+ 1. If server is specified: Use that server directly.
25
+ 2. If server is not specified:
26
+ - Step 1: Try CAS first: `sas-score-find-library({ name: "<lib>", server: "cas" })`
27
+ - Step 2: If not found in CAS, try SAS with the library name uppercased: `sas-score-find-library({ name: "<LIB>", server: "sas" })`
28
+ - Step 3: Report which server (or not found in either)
29
+
30
+ **Known default libraries**:
31
+ - CAS: Casuser, Formats, ModelPerformanceData, Models, Public, Samples, SystemData
32
+ - SAS: MAPS, MAPSGFK, MAPSSAS, SASDQREF, SASHELP, SASUSER, WORK
33
+
34
+ ---
35
+
36
+ ### 2. Find Table
37
+
38
+ **Trigger**: "find table X", "does table X exist in Y", "locate table X in library Y"
39
+
40
+ **Tool**: `sas-score-find-table`
41
+
42
+ **Required inputs**:
43
+ - Library name
44
+ - Table name
45
+ - Server (determined from library context or user specification)
46
+
47
+
48
+ **Logic**:
49
+ 1. If you already know that the table exists in a specific server, return that result directly.
50
+ 2. Otherwise, follow these steps:
51
+ - Step 1: If library is a known CAS library (Casuser, Public, Samples, etc.), use CAS as server.
52
+ - Step 2: If library is a known SAS library (SASHELP, WORK, SASUSER, etc.), use SAS as server.
53
+ - Step 3: If the server has been identified in an earlier step for this library, use that as the server.
54
+ 3. If server is known at this point:
55
+ - If server is SAS, uppercase the library name and try: `sas-score-find-table({ lib: "<LIB>", name: "<table>", server: "sas" })`
56
+ - Otherwise, use the provided server: `sas-score-find-table({ lib: "<library>", name: "<table>", server: "<server>" })`
57
+ 4. If server is not known:
58
+ - Step 1: Try CAS first: `sas-score-find-table({ lib: "<library>", name: "<table>", server: "cas" })`
59
+ - Step 2: If not found in CAS, try SAS with the library name uppercased: `sas-score-find-table({ lib: "<LIBRARY>", name: "<table>", server: "sas" })`
60
+ 5. If the table was found, report success and server.
61
+ 6. If not found, report failure.
62
+
63
+ **Output**: Table server location (CAS or SAS)
64
+
65
+ ---
66
+
67
+ ### 3. Find MAS Model
68
+
69
+ **Trigger**: "find model X", "does model X exist", "locate model X"
70
+
71
+ **Tool**: `sas-score-find-model`
72
+
73
+ **Logic**: Strip `.mas` suffix if present, use base name
74
+ - `sas-score-find-model({ name: "<model>" })`
75
+
76
+ ---
77
+
78
+ ### 4. Find Job
79
+
80
+ **Trigger**: "find job X", "does job X exist", "locate job X"
81
+
82
+ **Tool**: `sas-score-find-job`
83
+
84
+ **Logic**:
85
+ - `sas-score-find-job({ name: "<job>" })`
86
+
87
+ ---
88
+
89
+ ### 5. Find JobDef
90
+
91
+ **Trigger**: "find jobdef X", "does jobdef X exist", "locate jobdef X"
92
+
93
+ **Tool**: `sas-score-find-jobdef`
94
+
95
+ **Logic**:
96
+ - `sas-score-find-jobdef({ name: "<jobdef>" })`
97
+
98
+ ---
99
+
100
+ ### 6. Find SCR Model
101
+
102
+ **Trigger**: "find scr model X", "does scr model X exist"
103
+
104
+
105
+ **Action**: Ask user for the SCR URL/endpoint. SCR models do not have a pre-verification tool.
106
+ If the SCR URL/endpoint is invalid or missing, prompt the user to provide a valid URL.
107
+
108
+
109
+ ---
110
+
111
+
112
+
113
+ ## Generic Model Type Inference
114
+
115
+ If user says "find model X" without a type suffix, infer the type:
116
+
117
+ | Suffix | Type | Find Tool |
118
+ |---|---|---|
119
+ | `.mas` | MAS model | `sas-score-find-model` |
120
+ | `.job` | SAS Job | `sas-score-find-job` |
121
+ | `.jobdef` | SAS JobDef | `sas-score-find-jobdef` |
122
+ | `.scr` | SCR model | Skip (no find) |
123
+ | (none) | Default to MAS | `sas-score-find-model` |
124
+
125
+ ---
126
+
127
+ ## Clarifying Questions
128
+
129
+ If required information is missing:
130
+ - "Which library contains the table?" (if table lookup missing library)
131
+ - "Which server? (CAS or SAS)" (if ambiguous and not a known default)
132
+ - "Is this a MAS model, Job, or JobDef?" (if model type ambiguous)
133
+
134
+ ---
135
+
136
+ ## Output Format
137
+
138
+ For **found** resources:
139
+ - Confirm exact resource name from tool result
140
+ - Confirm server (for CAS/SAS resources)
141
+ - Example: "Found table customers in Public library (CAS)"
142
+
143
+ For **not found** resources:
144
+ - State clearly: "Table xyz not found in library ABC on either CAS or SAS"
145
+ - Ask for verification or correction
146
+
147
+ ---
148
+
149
+ ## Error Handling
150
+
151
+ If tool returns empty or error:
152
+ 1. Confirm the resource name spelling with user
153
+ 2. For tables: Confirm library name and server
154
+ 3. For models: Ask whether MAS, Job, or JobDef
155
+ 4. Ask user to verify resource exists on the server
@@ -0,0 +1,258 @@
1
+ ---
2
+ name: list-resource
3
+ description: >
4
+ Unified resource listing strategy. Use appropriate list tools for listing and browsing.
5
+ Determines pagination parameters. Use list tools for listing only; use find tools for verification of existence or discovery.
6
+ ---
7
+
8
+ # Unified Resource Listing Strategy
9
+
10
+
11
+ Use this strategy to list available resources (libraries, tables, models, jobs, jobdefs).
12
+
13
+ ## Resource Type to Tool Mapping
14
+
15
+ | Resource Type | List Tool |
16
+ |--------------|-----------|
17
+ | Libraries | sas-score-list-libraries |
18
+ | Tables | sas-score-list-tables |
19
+ | Models | sas-score-list-models |
20
+ | Jobs | sas-score-list-jobs |
21
+ | JobDefs | sas-score-list-jobdefs |
22
+
23
+ Use this table to select the correct tool for each resource type. Then follow the logic for parameters and pagination below.
24
+
25
+ ## Resource Types and List Tools
26
+
27
+ ### 1. List Libraries
28
+
29
+ **Trigger**: "list libraries", "show all libs", "list available libraries", "browse libraries"
30
+
31
+ **Tool**: `sas-score-list-libraries`
32
+
33
+ **Logic**:
34
+ - If server is specified: List from that server only
35
+ - If server is not specified: List from all servers (default)
36
+
37
+ **Parameters**:
38
+ ```
39
+ server: "cas" | "sas" | "all" # "cas" = CAS only, "sas" = SAS only, "all" = both
40
+ start: <offset> # 1-based page number (default 1)
41
+ limit: <page size> # items per page (default 10, max varies)
42
+ where: "<filter expression>" # optional filter
43
+ ```
44
+
45
+ **Examples**:
46
+ ```
47
+ # List all CAS libraries
48
+ sas-score-list-libraries({ server: "cas", start: 1, limit: 10 })
49
+
50
+ # List SAS libraries
51
+ sas-score-list-libraries({ server: "sas", start: 1, limit: 10 })
52
+
53
+ # List all libraries
54
+ sas-score-list-libraries({ server: "all", start: 1, limit: 10 })
55
+
56
+ # Pagination: show next page
57
+ sas-score-list-libraries({ server: "all", start: 11, limit: 10 })
58
+ ```
59
+
60
+ ---
61
+
62
+ ### 2. List Tables in Library
63
+
64
+ **Trigger**: "list tables in X", "show tables in library X", "browse tables in X", "what tables are in X"
65
+
66
+ **Tool**: `sas-score-list-tables`
67
+
68
+ **Required inputs**:
69
+ - Library name
70
+ - Server (determined from library context or user specification)
71
+
72
+ **Logic**:
73
+ - If library is a known CAS library (Casuser, Public, Samples, etc.), use CAS
74
+ - If library is a known SAS library (SASHELP, WORK, SASUSER, etc.), use SAS
75
+ - If ambiguous: Ask the user to clarify. If no clarification is provided, attempt both options (CAS and SAS) and return results for each, clearly labeled by server.
76
+
77
+ **Parameters**:
78
+ ```
79
+ lib: "<library>" # Required: library name
80
+ server: "cas" or "sas" # Determined from library
81
+ start: <offset> # 1-based page number (default 1)
82
+ limit: <page size> # items per page (default 10)
83
+ where: "<filter expression>" # optional filter
84
+ ```
85
+
86
+ **Examples**:
87
+ ```
88
+ # List tables in Public (CAS)
89
+ sas-score-list-tables({ lib: "Public", server: "cas", start: 1, limit: 10 })
90
+
91
+ # List tables in SASHELP (SAS)
92
+ sas-score-list-tables({ lib: "SASHELP", server: "sas", start: 1, limit: 10 })
93
+
94
+ # Pagination: show next page
95
+ sas-score-list-tables({ lib: "Public", server: "cas", start: 11, limit: 10 })
96
+ ```
97
+
98
+ ---
99
+
100
+ ### 3. List Models
101
+
102
+ **Trigger**: "list models", "show all models", "browse models", "what models are available"
103
+
104
+ **Tool**: `sas-score-list-models`
105
+
106
+ **Logic**: Lists all models published to the Model Administration Service (MAS).
107
+ - No server selection required (MAS is centralized)
108
+
109
+ **Parameters**:
110
+ ```
111
+ start: <offset> # 1-based page number (default 1)
112
+ limit: <size> # items per page (default 10)
113
+ ```
114
+
115
+ **Examples**:
116
+ ```
117
+ # List first 10 models
118
+ sas-score-list-models({ start: 1, limit: 10 })
119
+
120
+ # List 25 models
121
+ sas-score-list-models({ start: 1, limit: 25 })
122
+
123
+ # Pagination: show next page
124
+ sas-score-list-models({ start: 11, limit: 10 })
125
+ ```
126
+
127
+ ---
128
+
129
+ ### 4. List Jobs
130
+
131
+ **Trigger**: "list jobs", "show all jobs", "browse jobs", "what jobs are available"
132
+
133
+ **Tool**: `sas-score-list-jobs`
134
+
135
+ **Logic**: Lists all SAS Viya job assets.
136
+
137
+ **Parameters**:
138
+ ```
139
+ start: <offset> # 1-based page number (default 1)
140
+ limit: <page size> # items per page (default 10)
141
+ where: "<filter expression>" # optional filter
142
+ ```
143
+
144
+ **Examples**:
145
+ ```
146
+ # List first 10 jobs
147
+ sas-score-list-jobs({ start: 1, limit: 10 })
148
+
149
+ # List 25 jobs
150
+ sas-score-list-jobs({ start: 1, limit: 25 })
151
+
152
+ # Pagination: show next page
153
+ sas-score-list-jobs({ start: 11, limit: 10 })
154
+ ```
155
+
156
+ ---
157
+
158
+ ### 5. List JobDefs
159
+
160
+ **Trigger**: "list jobdefs", "show all jobdefs", "browse jobdefs", "what jobdefs are available"
161
+
162
+ **Tool**: `sas-score-list-jobdefs`
163
+
164
+ **Logic**: Lists all SAS Viya job definition assets.
165
+
166
+ **Parameters**:
167
+ ```
168
+ start: <offset> # 1-based page number (default 1)
169
+ limit: <page size> # items per page (default 10)
170
+ where: "<filter expression>" # optional filter
171
+ ```
172
+
173
+ **Examples**:
174
+ ```
175
+ # List first 10 jobdefs
176
+ sas-score-list-jobdefs({ start: 1, limit: 10 })
177
+
178
+ # List 25 jobdefs
179
+ sas-score-list-jobdefs({ start: 1, limit: 25 })
180
+
181
+ # Pagination: show next page
182
+ sas-score-list-jobdefs({ start: 11, limit: 10 })
183
+ ```
184
+
185
+ ---
186
+
187
+ ## Pagination Strategy
188
+
189
+ All list operations support pagination via `start` and `limit` parameters:
190
+
191
+ | Parameter | Type | Default | Notes |
192
+ |---|---|---|---|
193
+ | `start` | number | 1 | 1-based page offset |
194
+ | `limit` | number | 10 | items per page |
195
+
196
+ **Pagination Detection**:
197
+ ```
198
+ If returned items < limit
199
+ → End of list reached
200
+ Else if returned items === limit
201
+ → Hint: More items available. Next start = start + limit
202
+ ```
203
+
204
+ **Example**:
205
+ ```
206
+ List 1: start=1, limit=10 → returns 10 items
207
+ List 2: start=11, limit=10 → returns 10 items
208
+ List 3: start=21, limit=10 → returns 5 items (< limit)
209
+ → End of list (total: 25 items)
210
+ ```
211
+
212
+ ---
213
+
214
+ ## Decision Tree
215
+
216
+ ```
217
+ User requests to list/browse resources
218
+
219
+ What resource type?
220
+ ├─ Libraries? → Use sas-score-list-libraries
221
+ ├─ Tables in library X? → Use sas-score-list-tables
222
+ ├─ Models? → Use sas-score-list-models
223
+ ├─ Jobs? → Use sas-score-list-jobs
224
+ └─ JobDefs? → Use sas-score-list-jobdefs
225
+ ```
226
+
227
+ ---
228
+
229
+ ## Known Default Libraries
230
+
231
+ ### CAS Libraries (server: "cas")
232
+ - Casuser
233
+ - Formats
234
+ - ModelPerformanceData
235
+ - Models
236
+ - Public
237
+ - Samples
238
+ - SystemData
239
+
240
+ ### SAS Libraries (server: "sas")
241
+ - MAPS
242
+ - MAPSGFK
243
+ - MAPSSAS
244
+ - SASDQREF
245
+ - SASHELP
246
+ - SASUSER
247
+ - WORK
248
+
249
+ ---
250
+
251
+ ## Differences: Find vs List
252
+
253
+ | Aspect | Find | List |
254
+ |---|---|---|
255
+ | Purpose | Verify/discover existence | List available resources |
256
+ | Returns | Single resource or not found | Multiple resources with pagination |
257
+ | Use case | Before execution | Listing of resources |
258
+ | Tool suffix | `find-*` | `list-*` |