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

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 (65) hide show
  1. package/.skills/agents/sas-score-mcp-serverjs-agent.md +190 -0
  2. package/.skills/copilot-instructions.md +234 -0
  3. package/.skills/skills/README.md +125 -0
  4. package/.skills/skills/detail-strategy/SKILL.md +244 -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 +103 -0
  9. package/.skills/skills/score-strategy/SKILL.md +229 -0
  10. package/README.md +45 -22
  11. package/cli.js +37 -27
  12. package/package.json +8 -10
  13. package/scripts/refreshtoken.js +58 -0
  14. package/scripts/setup-skills.js +1 -1
  15. package/scripts/token.txt +1 -0
  16. package/src/expressMcpServer.js +47 -49
  17. package/src/oauthHandlers/authorize.js +4 -1
  18. package/src/oauthHandlers/baseUrl.js +4 -0
  19. package/src/oauthHandlers/callback.js +5 -1
  20. package/src/oauthHandlers/getMetadata.js +4 -0
  21. package/src/oauthHandlers/index.js +4 -0
  22. package/src/oauthHandlers/token.js +4 -0
  23. package/src/processHeaders.js +10 -7
  24. package/src/setupSkills.js +12 -7
  25. package/src/toolHelpers/_listJobs.js +1 -0
  26. package/src/toolHelpers/_listLibrary.js +1 -1
  27. package/src/toolHelpers/_listTables.js +1 -1
  28. package/src/toolHelpers/getLogonPayload.js +2 -2
  29. package/src/toolSet/findJobdef.js +5 -5
  30. package/src/toolSet/modelScore.js +23 -25
  31. package/src/toolSet/runCasProgram.js +21 -10
  32. package/src/toolSet/runJob.js +15 -19
  33. package/src/toolSet/runJobdef.js +15 -19
  34. package/src/toolSet/scrScore.js +60 -69
  35. package/.skills_claude/README.md +0 -303
  36. package/.skills_claude/TESTING_GUIDE.md +0 -252
  37. package/.skills_claude/agents/sas-viya-scoring-expert.md +0 -58
  38. package/.skills_claude/claude-desktop-config.json +0 -16
  39. package/.skills_claude/claude-desktop-system-prompt.md +0 -127
  40. package/.skills_claude/copilot-instructions.md +0 -155
  41. package/.skills_claude/instructions.md +0 -184
  42. package/.skills_claude/skills/sas-find-library-smart/SKILL.md +0 -157
  43. package/.skills_claude/skills/sas-find-resource-strategy/SKILL.md +0 -105
  44. package/.skills_claude/skills/sas-list-resource-strategy/SKILL.md +0 -124
  45. package/.skills_claude/skills/sas-list-tables-smart/SKILL.md +0 -126
  46. package/.skills_claude/skills/sas-read-and-score/SKILL.md +0 -112
  47. package/.skills_claude/skills/sas-read-strategy/SKILL.md +0 -154
  48. package/.skills_claude/skills/sas-request-classifier/SKILL.md +0 -69
  49. package/.skills_claude/skills/sas-score-workflow/SKILL.md +0 -200
  50. package/.skills_claude/skills-index.md +0 -345
  51. package/.skills_github/agents/sas-viya-scoring-expert.md +0 -58
  52. package/.skills_github/copilot-instructions.md +0 -177
  53. package/.skills_github/skills/sas-find-library-smart/SKILL.md +0 -155
  54. package/.skills_github/skills/sas-find-resource-strategy/SKILL.md +0 -105
  55. package/.skills_github/skills/sas-list-resource-strategy/SKILL.md +0 -124
  56. package/.skills_github/skills/sas-list-tables-smart/SKILL.md +0 -128
  57. package/.skills_github/skills/sas-read-and-score/SKILL.md +0 -113
  58. package/.skills_github/skills/sas-read-strategy/SKILL.md +0 -154
  59. package/.skills_github/skills/sas-request-classifier/SKILL.md +0 -74
  60. package/.skills_github/skills/sas-score-workflow/SKILL.md +0 -314
  61. package/src/authpkce.js +0 -219
  62. package/src/handleGetDelete.js +0 -34
  63. package/src/handleRequest.js +0 -112
  64. package/src/hapiMcpServer.js +0 -241
  65. package/src/toolSet/.claude/settings.local.json +0 -13
@@ -0,0 +1,244 @@
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, except for SCR models (which do not require pre-verification).
6
+ ---
7
+
8
+ # Detail Strategy
9
+
10
+
11
+ Use this strategy when the user requests information about a resource: model details, schema, metadata, inputs/outputs, or any descriptive information.
12
+
13
+ If the resource type is ambiguous or cannot be determined, ask the user for clarification.
14
+ If the resource type is not MAS, SCR, or table, respond with: "Unsupported resource type. Please specify MAS model, SCR model, or table."
15
+
16
+
17
+ ## Simplified Steps
18
+
19
+ 1. Determine resource type (MAS model, SCR model, or table)
20
+ 2. If MAS model or table, verify resource exists using find-resources skill
21
+ - If SCR model, skip verification and proceed to retrieval
22
+ 3. Retrieve details using the appropriate tool
23
+
24
+ ---
25
+
26
+
27
+ ## Step 1: Identify Resource Type
28
+
29
+ Classify the resource based on naming convention or context:
30
+
31
+ | Pattern | Resource Type |
32
+ |--------------------------------|--------------|
33
+ | model X.mas or "model X" | MAS model |
34
+ | model X.scr | SCR model |
35
+ | table X in library Y | Table |
36
+
37
+ If resource type cannot be determined, ask the user for clarification.
38
+
39
+ ---
40
+
41
+ ## Step 2: Verify Resource Exists (if required)
42
+
43
+ | Resource Type | Verification Required? | How to Verify |
44
+ |---------------|-----------------------|---------------|
45
+ | MAS model | Yes | find-model |
46
+ | SCR model | No | — |
47
+ | Table | Yes | find-table |
48
+
49
+ If resource type is not supported, respond with: "Unsupported resource type. Please specify MAS model, SCR model, or table."
50
+
51
+ ### Find SCR Model
52
+ ```
53
+ find-resources skill → find-scr
54
+ Tool: sas-score-find-scr({ url: "<scr-endpoint>" })
55
+ ```
56
+
57
+ ### Find Table
58
+ ```
59
+ find-resources skill → find-table
60
+ Tool: sas-score-find-table({ lib: "<library>", name: "<table>", server: "<cas|sas>" })
61
+ ```
62
+
63
+ ---
64
+
65
+ ## Step 3: Get Details
66
+
67
+ ### Option A: MAS Model Details
68
+
69
+ **Trigger phrases**: "what inputs does model X need", "describe model X", "show variables for model X", "model X metadata", "model X information"
70
+
71
+ **Tool**: `sas-score-model-info`
72
+
73
+ **Parameters**:
74
+ ```
75
+ sas-score-model-info({
76
+ model: "<model name>"
77
+ })
78
+ ```
79
+
80
+ **Returns**:
81
+ - Input variables (name, type, role)
82
+ - Output variables (name, type, possible_values)
83
+ - Model type
84
+ - Description
85
+
86
+ **Example**:
87
+ ```
88
+ User: "What inputs does model churnRisk need?"
89
+
90
+ 1. Find: sas-score-find-model({ name: "churnRisk" })
91
+ 2. Get info: sas-score-model-info({ model: "churnRisk" })
92
+ 3. Return: { inputs: [...], outputs: [...], description: "..." }
93
+ ```
94
+
95
+ ---
96
+
97
+ ### Option B: SCR Model Details
98
+
99
+ **Trigger phrases**: "what does SCR model X need", "describe SCR model X", "SCR model X inputs", "SCR model X schema"
100
+
101
+ **Tool**: `sas-score-scr-info`
102
+
103
+ **Parameters**:
104
+ ```
105
+ sas-score-scr-info({
106
+ url: "<scr endpoint>"
107
+ })
108
+ ```
109
+
110
+ **Returns**:
111
+ - Input schema (variable names, types, required/optional)
112
+ - Output schema (prediction, probabilities, scores)
113
+ - Model metadata
114
+
115
+ **Example**:
116
+ ```
117
+ User: "Show inputs for SCR model at https://scr-host/models/loan"
118
+
119
+ 1. Get info: sas-score-scr-info({ url: "https://scr-host/models/loan" })
120
+ 2. Return: { inputs: [...], outputs: [...] }
121
+ ```
122
+
123
+ **Note**: SCR models typically do not require pre-verification (can call scr-info directly)
124
+
125
+ ---
126
+
127
+ ### Option C: Table Details
128
+
129
+ **Trigger phrases**: "what columns in table X", "describe table X", "show schema for table X", "table X structure", "table X metadata"
130
+
131
+ **Tool**: `sas-score-table-info`
132
+
133
+ **Parameters**:
134
+ ```
135
+ sas-score-table-info({
136
+ lib: "<library>",
137
+ table: "<table name>",
138
+ server: "<cas|sas>"
139
+ })
140
+ ```
141
+
142
+ **Returns**:
143
+ - Columns array (name, type, label, format, length)
144
+ - Table info (rowCount, fileSize, created, modified)
145
+
146
+ **Example**:
147
+ ```
148
+ User: "What columns are in the customers table in Public?"
149
+
150
+ 1. Find: sas-score-find-table({ lib: "Public", name: "customers", server: "cas" })
151
+ 2. Get info: sas-score-table-info({ lib: "Public", table: "customers", server: "cas" })
152
+ 3. Return: { columns: [...], tableInfo: {...} }
153
+ ```
154
+
155
+ ---
156
+
157
+ ## Decision Tree
158
+
159
+ ```
160
+ User requests information/details
161
+ ├─ About a MAS model?
162
+ │ → Find model (find-resources)
163
+ │ → Call: sas-score-model-info
164
+
165
+ ├─ About a SCR model?
166
+ │ → Call: sas-score-scr-info (can skip verification)
167
+
168
+ └─ About a table?
169
+ → Find table (find-resources, determine server)
170
+ → Call: sas-score-table-info
171
+ ```
172
+
173
+ ---
174
+
175
+ ## Implementation Checklist
176
+
177
+ For each detail/information request:
178
+
179
+ - [ ] **Classify** resource type (MAS/SCR/table)
180
+ - [ ] **Verify** resource exists (use find-resources skill, except SCR)
181
+ - [ ] **Determine** server for tables (CAS or SAS)
182
+ - [ ] **Execute** appropriate detail tool
183
+ - [ ] **Format** results (column alignment, readable structure)
184
+ - [ ] **Append** Strategy Summary to response
185
+
186
+ ---
187
+
188
+ ## Response Format
189
+
190
+ Always append a **Strategy Summary** to responses:
191
+
192
+ ```
193
+ ---
194
+
195
+ **Strategy Summary:**
196
+ - **Classification**: [Resource type identified]
197
+ - **Verification**: [Resource found or skipped (SCR)]
198
+ - **Tool Used**: [Detail tool invoked]
199
+ - **Server**: [CAS/SAS for tables, N/A for models]
200
+ ```
201
+
202
+ ---
203
+
204
+ ## Error Recovery
205
+
206
+ If a request fails:
207
+
208
+ 1. **Resource not found** → Ask user to verify name/spelling
209
+ 2. **Server mismatch** → Re-verify server location with find-resources
210
+ 3. **Invalid URL (SCR)** → Ask for correct SCR endpoint URL
211
+ 4. **Tool error** → Return error message verbatim and ask for clarification
212
+
213
+ ---
214
+
215
+ ## Examples
216
+
217
+ ### Example 1: Model Information
218
+
219
+ **User**: "Describe model creditScore"
220
+
221
+ **Workflow**:
222
+ 1. Classify: MAS model detail request
223
+ 2. Verify: Find model creditScore → Found ✓
224
+ 3. Execute: `sas-score-model-info({ model: "creditScore" })`
225
+ 4. Return: Model inputs, outputs, and description
226
+
227
+ ### Example 2: SCR Model Schema
228
+
229
+ **User**: "What inputs does the SCR loan model need?"
230
+
231
+ **Workflow**:
232
+ 1. Classify: SCR model detail request
233
+ 2. Execute: `sas-score-scr-info({ url: "https://scr-host/models/loan" })`
234
+ 3. Return: Input schema and output schema
235
+
236
+ ### Example 3: Table Columns
237
+
238
+ **User**: "Show columns for customers in Public"
239
+
240
+ **Workflow**:
241
+ 1. Classify: Table detail request
242
+ 2. Verify: Find table customers in Public → CAS ✓
243
+ 3. Execute: `sas-score-table-info({ lib: "Public", table: "customers", server: "cas" })`
244
+ 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 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
+
11
+ Use this strategy to discover and browse 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 existence | Browse/discover |
256
+ | Returns | Single resource or not found | Multiple resources with pagination |
257
+ | Use case | Before execution | Exploration/discovery |
258
+ | Tool suffix | `find-*` | `list-*` |