@sassoftware/sas-score-mcp-serverjs 1.0.1-9 → 1.1.1

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 (118) hide show
  1. package/.skills/.claude-plugin/plugin.json +59 -0
  2. package/.skills/agents/sas-score-mcp-serverjs-agent.md +26 -0
  3. package/.skills/copilot-instructions.md +62 -0
  4. package/.skills/skills/README.md +204 -0
  5. package/.skills/skills/detail-strategy/SKILL.md +316 -0
  6. package/.skills/skills/find-library-server/SKILL.md +62 -0
  7. package/.skills/skills/find-resources/SKILL.md +66 -0
  8. package/.skills/skills/list-library/SKILL.md +30 -0
  9. package/.skills/skills/list-mas-job-jobdef/SKILL.md +31 -0
  10. package/.skills/skills/list-tables/SKILL.md +30 -0
  11. package/.skills/skills/read-strategy/SKILL.md +87 -0
  12. package/.skills/skills/request-routing/SKILL.md +112 -0
  13. package/.skills/skills/score-cas/SKILL.md +95 -0
  14. package/.skills/skills/score-job-jobdef/SKILL.md +58 -0
  15. package/.skills/skills/score-mas-scr/SKILL.md +58 -0
  16. package/.skills/skills/score-program/SKILL.md +59 -0
  17. package/.skills/skills/score-strategy/SKILL.md +39 -0
  18. package/README.md +96 -54
  19. package/cli.js +11 -13
  20. package/openApi.yaml +121 -121
  21. package/package.json +16 -14
  22. package/scripts/docs/SCORE_SKILL_REFERENCE.md +17 -16
  23. package/scripts/docs/TOOL_DESCRIPTION_TEMPLATE.md +3 -3
  24. package/scripts/docs/TOOL_UPDATES_SUMMARY.md +65 -63
  25. package/scripts/docs/oauth-http-transport.md +2 -2
  26. package/scripts/docs/sas-mcp-tools-reference.md +43 -32
  27. package/scripts/plot_msrp_usa.py +49 -0
  28. package/scripts/refreshtoken.js +58 -0
  29. package/scripts/runListScr.mjs +16 -0
  30. package/src/createMcpServer.js +4 -1
  31. package/src/expressMcpServer.js +47 -49
  32. package/src/oauthHandlers/authorize.js +4 -1
  33. package/src/oauthHandlers/baseUrl.js +4 -0
  34. package/src/oauthHandlers/callback.js +4 -0
  35. package/src/oauthHandlers/getMetadata.js +4 -0
  36. package/src/oauthHandlers/index.js +4 -0
  37. package/src/oauthHandlers/token.js +4 -0
  38. package/src/openApi.yaml +121 -121
  39. package/src/processHeaders.js +10 -7
  40. package/src/setupSkills.js +1 -18
  41. package/src/toolHelpers/_casScore.js +32 -0
  42. package/src/toolHelpers/_desc.js +14 -0
  43. package/src/toolHelpers/_findJob.js +12 -0
  44. package/src/toolHelpers/_findJobdef.js +10 -0
  45. package/src/toolHelpers/_findLibrary.js +11 -0
  46. package/src/toolHelpers/_findMas.js +13 -0
  47. package/src/toolHelpers/_findScr.js +36 -0
  48. package/src/toolHelpers/_findTable.js +11 -0
  49. package/src/toolHelpers/_listJobdefs.js +12 -2
  50. package/src/toolHelpers/_listJobs.js +19 -8
  51. package/src/toolHelpers/{_listModels.js → _listMas.js} +4 -4
  52. package/src/toolHelpers/_listScr.js +13 -0
  53. package/src/toolHelpers/{_scrInfo.js → _scrDescribe.js} +4 -4
  54. package/src/toolHelpers/_scrScore.js +2 -2
  55. package/src/toolHelpers/_submitCasl.js +19 -17
  56. package/src/toolHelpers/{_tableInfo.js → _tableDescribe.js} +2 -2
  57. package/src/toolHelpers/getLogonPayload.js +2 -2
  58. package/src/toolSet/casModelScore.js +93 -0
  59. package/src/toolSet/casProgramScore.js +105 -0
  60. package/src/toolSet/devaScore.js +11 -6
  61. package/src/toolSet/findJob.js +74 -59
  62. package/src/toolSet/findJobdef.js +67 -64
  63. package/src/toolSet/findLibrary.js +28 -23
  64. package/src/toolSet/findMas.js +72 -0
  65. package/src/toolSet/findScr.js +69 -0
  66. package/src/toolSet/findTable.js +34 -27
  67. package/src/toolSet/getEnv.js +57 -57
  68. package/src/toolSet/jobDescribe.js +65 -0
  69. package/src/toolSet/jobScore.js +90 -0
  70. package/src/toolSet/jobdefDescribe.js +67 -0
  71. package/src/toolSet/jobdefScore.js +85 -0
  72. package/src/toolSet/listJobdefs.js +17 -8
  73. package/src/toolSet/listJobs.js +15 -8
  74. package/src/toolSet/listLibraries.js +16 -10
  75. package/src/toolSet/listMas.js +71 -0
  76. package/src/toolSet/listScr.js +62 -0
  77. package/src/toolSet/listTables.js +78 -66
  78. package/src/toolSet/{runMacro.js → macroScore.js} +86 -82
  79. package/src/toolSet/makeTools.js +39 -25
  80. package/src/toolSet/masDescribe.js +67 -0
  81. package/src/toolSet/masScore.js +95 -0
  82. package/src/toolSet/{runProgram.js → programScore.js} +96 -93
  83. package/src/toolSet/readTable.js +43 -26
  84. package/src/toolSet/sasQuery.js +24 -18
  85. package/src/toolSet/scrDescribe.js +55 -0
  86. package/src/toolSet/scrScore.js +63 -70
  87. package/src/toolSet/searchAssets.js +1 -1
  88. package/src/toolSet/setContext.js +8 -3
  89. package/src/toolSet/superstat.js +61 -61
  90. package/src/toolSet/tableDescribe.js +65 -0
  91. package/.agents/sas-score-mcp-serverjs-agent.md +0 -58
  92. package/.instructions/copilot-instructions.md +0 -201
  93. package/.instructions/enforce-find-resource-strategy.md +0 -35
  94. package/.skills/sas-find-library-smart/SKILL.md +0 -155
  95. package/.skills/sas-find-resource-strategy/SKILL.md +0 -105
  96. package/.skills/sas-list-resource-strategy/SKILL.md +0 -124
  97. package/.skills/sas-list-tables-smart/SKILL.md +0 -128
  98. package/.skills/sas-read-and-score-strategy/SKILL.md +0 -113
  99. package/.skills/sas-read-strategy/SKILL.md +0 -154
  100. package/.skills/sas-request-classifier/SKILL.md +0 -74
  101. package/.skills/sas-score-workflow-strategy/SKILL.md +0 -314
  102. package/scripts/optimize_final.py +0 -140
  103. package/scripts/optimize_tools.py +0 -99
  104. package/scripts/setup-skills.js +0 -34
  105. package/scripts/update_descriptions.py +0 -46
  106. package/src/authpkce.js +0 -219
  107. package/src/handleGetDelete.js +0 -34
  108. package/src/handleRequest.js +0 -112
  109. package/src/hapiMcpServer.js +0 -241
  110. package/src/toolSet/findModel.js +0 -60
  111. package/src/toolSet/listModels.js +0 -56
  112. package/src/toolSet/modelInfo.js +0 -55
  113. package/src/toolSet/modelScore.js +0 -89
  114. package/src/toolSet/runCasProgram.js +0 -98
  115. package/src/toolSet/runJob.js +0 -81
  116. package/src/toolSet/runJobdef.js +0 -82
  117. package/src/toolSet/scrInfo.js +0 -52
  118. package/src/toolSet/tableInfo.js +0 -58
@@ -0,0 +1,59 @@
1
+ {
2
+ "name": "sas-score-mcp-serverjs",
3
+ "displayName": "SAS Viya Score MCP",
4
+ "version": "0.0.6",
5
+ "description": "Skills, agent, and MCP server for reading and scoring data via SAS Viya",
6
+ "author": {
7
+ "name": "Deva Kumar",
8
+ "email": "deva.kumar@sas.com"
9
+ },
10
+ "repository": "https://github.com/sassoftware/sas-score-mcp-serverjs",
11
+ "license": "Apache-2.0",
12
+ "keywords": [
13
+ "sas",
14
+ "viya",
15
+ "scoring",
16
+ "mcp",
17
+ "analytics"
18
+ ],
19
+ "skills": "./skills/",
20
+ "agents": [
21
+ "./agents/sas-score-mcp-serverjs-agent.md"
22
+ ],
23
+ "mcpServers": {
24
+ "sas-score-mcp-serverjs": {
25
+ "command": "npx",
26
+ "args": [
27
+ "-y",
28
+ "@sassoftware/sas-score-mcp-serverjs"
29
+ ],
30
+ "env": {
31
+ "VIYA_SERVER": "${VIYA_SERVER}",
32
+ "AUTHFLOW": "${AUTHFLOW:-sascli}",
33
+ "CLIENTID": "${CLIENTID:-vscodemcp}",
34
+ "AGENT": "${AGENT:-TRUE}"
35
+ }
36
+ }
37
+ },
38
+ "userConfig": {
39
+ "VIYA_SERVER": {
40
+ "type": "string",
41
+ "title": "SAS Viya server URL",
42
+ "description": "Base URL of your SAS Viya server, e.g. https://my-viya.example.com",
43
+ "required": true
44
+ },
45
+ "AUTHFLOW": {
46
+ "type": "string",
47
+ "title": "Auth flow",
48
+ "description": "Authentication flow: oauth, code, sascli, token, or bearer",
49
+ "default": "sascli"
50
+ },
51
+
52
+ "AGENT": {
53
+ "type": "string",
54
+ "title": "Agent mode",
55
+ "description": "If TRUE, the skills must be deployed",
56
+ "default": "TRUE"
57
+ }
58
+ }
59
+ }
@@ -0,0 +1,26 @@
1
+ ---
2
+ name: sas-score-mcp-serverjs-agent
3
+ description: >
4
+ Unified orchestration agent for scoring in SAS Viya.
5
+ Follow the canonical SKILL at [skills/request-routing/SKILL.md](skills/request-routing/SKILL.md).
6
+ ---
7
+
8
+ # SAS Viya Unified Router
9
+
10
+ **Default Agent Mode**: Use the request-routing strategy for all requests.
11
+
12
+ Agent defaults
13
+ - Append the **Strategy Summary** to every response.
14
+
15
+ Behavior (high-level)
16
+ - Classification → Verification → Execution → Formatting (Strategy Summary appended).
17
+ - For Read+Score flows, follow the SKILL's Combined Read+Score steps.
18
+
19
+ Implementation checklist (agent-level)
20
+ - Classify request and consult SKILL for decision-making.
21
+ - Invoke find-* tools for verification
22
+ - Call execution tools mapped in the SKILL.
23
+ - Surface errors verbatim and ask targeted clarification questions when needed.
24
+
25
+ See the canonical router for the full mapping, rules, examples, and Strategy Summary template: [skills/request-routing/SKILL.md](skills/request-routing/SKILL.md)
26
+
@@ -0,0 +1,62 @@
1
+ # GitHub Copilot — SAS Viya (concise agent guide)
2
+
3
+ This file is a short, agent-facing reference. It delegates routing and detailed decision logic to the canonical SKILLs in the `skills/` folder (especially `skills/request-routing/SKILL.md`). Keep this file minimal — use the SKILLs for examples and edge cases.
4
+
5
+ **Core principle (single sentence):** Verify resources, execute with the mapped tool, and format results.
6
+
7
+ ## Canonical workflow
8
+ - Verify: confirm resources exist using `find-*` tools
9
+ - Execute: call the execution tool mapped by the router (read/query/score/describe/list).
10
+ - Format: merge outputs, present results, and append a short Strategy Summary.
11
+
12
+ Note: the five-step phrasing (Identify → Verify → Select → Execute → Format) maps to the same implementation; prefer the three-step mental model when implementing.
13
+
14
+ ## Agent defaults
15
+ - Default model type: MAS (unless user specifies `.job`, `.jobdef`, `.scr`, `.sas`, or `.casl`).
16
+ - Append a **Strategy Summary** to every response.
17
+ - Always determine table server (CAS vs SAS) during verification; ask if ambiguous.
18
+ - Do not invent resource names, servers, or model types — verify or ask.
19
+ - Pagination: always pass `start=1` and `limit=10` when calling any tool that accepts these parameters, unless the user specifies different values.
20
+
21
+ ## Model types
22
+ All of the following are treated as **models** that can be scored:
23
+ - **MAS** (`.mas`) — Micro Analytic Score: `sas-score-mas-score`
24
+ - **SCR** (`.scr`) — Score Code Runtime: `sas-score-scr-score`
25
+ - **Job** (`.job`) — SAS Viya Job model: `sas-score-job-score`
26
+ - **JobDef** (`.jobdef`) — SAS Viya Job Definition model: `sas-score-jobdef-score`
27
+ - **Program** (`.sas`) — SAS Program model: `sas-score-program-score`
28
+ - **CAS Program** (`.casl`) — CASL Program model: `sas-score-cas-program-score`
29
+ - **Macro** — SAS macro by name: `sas-score-macro-score`
30
+
31
+ ## Canonical tool mappings (short)
32
+ - Find: `sas-score-find-library`, `sas-score-find-table`, `sas-score-find-mas`, `sas-score-find-job`, `sas-score-find-jobdef`
33
+ - Read / Query: `sas-score-read-table`, `sas-score-sas-query`
34
+ - Score models: `sas-score-mas-score`, `sas-score-scr-score`, `sas-score-job-score`, `sas-score-jobdef-score`, `sas-score-program-score`, `sas-score-cas-program-score`, `sas-score-macro-score`
35
+ - List: `sas-score-list-libraries`, `sas-score-list-tables`, `sas-score-list-mas`, `sas-score-list-jobs`, `sas-score-list-jobdefs`
36
+ - Detail: `sas-score-mas-describe`, `sas-score-job-describe`, `sas-score-jobdef-describe`, `sas-score-scr-describe`, `sas-score-table-describe`
37
+
38
+ ## Strategy Summary (append to replies)
39
+ ---
40
+ **Strategy Summary:**
41
+ - **Classification**: [Find / Read / Score / List / Describe]
42
+ - **Verification**: [Resources verified / skipped]
43
+ - **Tool(s)**: [Primary tool(s) invoked]
44
+ - **Decision**: [Server chosen, model type, mapping]
45
+ - **Next steps**: [Follow-ups or clarifications]
46
+
47
+ ## When to ask a clarification (one focused question)
48
+ - Missing or ambiguous resource name
49
+ - Model type not specified (`.mas` / `.job` / `.jobdef` / `.scr` / `.sas` / `.casl`)
50
+ - Table library or server not specified
51
+ - Column-to-model-input mapping is unclear
52
+
53
+ ## References
54
+ - Canonical router, examples, and Strategy Summary template: `skills/request-routing/SKILL.md`
55
+ - Find/verify resources: `skills/find-resources/SKILL.md`
56
+ - List/browse resources: `skills/list-resource/SKILL.md`
57
+ - Read/query data: `skills/read-strategy/SKILL.md`
58
+ - Scoring workflows: `skills/score-strategy/SKILL.md`
59
+ - Describe/detail resources: `skills/detail-strategy/SKILL.md`
60
+ - Decision trees (machine-readable): `decision-trees/`
61
+
62
+ Keep this file short. Use the SKILLs for decision trees, examples, and edge-case rules.
@@ -0,0 +1,204 @@
1
+ # SAS Viya Unified Strategy - Quick Reference
2
+
3
+ This folder contains simplified, consolidated strategies for working with SAS Viya through the MCP server.
4
+
5
+ > **Claude Code Plugin**: The parent `.skills/` directory is a Claude Code plugin. See [Plugin Usage](#plugin-usage) at the bottom of this file for installation instructions.
6
+
7
+ ## Files
8
+
9
+ ### Core Strategies
10
+
11
+ 1. **request-routing** — Universal three-step workflow
12
+ - Step 1: Verify resources exist
13
+ - Step 2: Execute the request
14
+ - Step 3: Merge results
15
+
16
+ 2. **find-library-server** — Library existence and server verification
17
+ - Verifies a library exists in CAS or SAS
18
+ - Returns confirmed `{ lib, server }` pair
19
+ - Called by find-resources and list-tables before any library-scoped operation
20
+
21
+ 3. **find-resources** — Resource verification strategy
22
+ - How to find/verify libraries, tables, models, jobs, jobdefs
23
+ - Delegates library checks to find-library-server
24
+ - Server determination logic
25
+
26
+ 3. **list-library** — List SAS Viya libraries
27
+ - Calls sas-score-list-libraries with server parameter
28
+
29
+ 4. **list-tables** — List tables in a library
30
+ - Verifies library exists (CAS first, then SAS) before listing
31
+ - Passes confirmed lib and server to sas-score-list-tables
32
+
33
+ 5. **list-mas-job-jobdef** — List MAS models, Jobs, and JobDefs
34
+ - Routes to sas-score-list-mas, sas-score-list-jobs, or sas-score-list-jobdefs
35
+
36
+ 6. **read-strategy** — Data reading strategy
37
+ - Raw row reads (sas-score-read-table)
38
+ - Analytical queries (sas-score-sas-query)
39
+ - Decision tree for choosing the right tool
40
+
41
+ 7. **score-strategy** — Scoring workflow
42
+ - All model types: MAS, SCR, Job, JobDef, Program, CAS Program
43
+ - Inline scenarios vs table rows
44
+ - Result formatting and merging
45
+
46
+ ### Agent
47
+
48
+ 8. **sas-score-mcp-serverjs-agent** — Main agent instructions
49
+ - Orchestration logic
50
+ - Decision trees
51
+ - Implementation checklist
52
+
53
+ ---
54
+
55
+ ## Key Principles
56
+
57
+ ### 1. Three-Step Workflow (Always)
58
+
59
+ Every request follows the same pattern:
60
+ ```
61
+ Verify → Execute → Format
62
+ ```
63
+
64
+ ### 2. No Ambiguity
65
+
66
+ - Clear classification of request type
67
+ - Explicit server determination for tables (CAS vs SAS)
68
+ - Explicit model type determination (MAS / SCR / Job / JobDef / Program / CAS Program)
69
+
70
+ ### 3. Verification Before Execution
71
+
72
+ Always verify resources exist before executing (except SCR which has no pre-check).
73
+
74
+ ### 4. Simplified Tool Mapping
75
+
76
+ | Resource | Tool |
77
+ |---|---|
78
+ | Find library | sas-score-find-library |
79
+ | Find table | sas-score-find-table |
80
+ | Find model (MAS) | sas-score-find-mas |
81
+ | Find job | sas-score-find-job |
82
+ | Find jobdef | sas-score-find-jobdef |
83
+ | Read table | sas-score-read-table |
84
+ | Query table | sas-score-sas-query |
85
+ | Score (MAS) | sas-score-mas-score |
86
+ | Score (SCR) | sas-score-scr-score |
87
+ | Score (Job model) | sas-score-job-score |
88
+ | Score (JobDef model) | sas-score-jobdef-score |
89
+ | Score (Program model) | sas-score-program-score |
90
+ | Score (CAS Program model) | sas-score-cas-program-score |
91
+
92
+ ---
93
+
94
+ ## Using These Strategies
95
+
96
+ 1. **Start with request-routing** to understand the three-step workflow
97
+ 2. **Use find-resources** when verifying resources
98
+ 3. **Use read-strategy** when reading data
99
+ 4. **Use score-strategy** when scoring/predicting
100
+ 5. **Reference agent sas-score-mcp-serverjs-agent.md** for orchestration
101
+
102
+ ---
103
+
104
+ ## Why Simplified?
105
+
106
+ The original `.skills` folder had multiple overlapping strategies that caused confusion:
107
+ - Multiple ways to find the same resource
108
+ - Unclear when to use read vs query
109
+ - Ambiguous model type inference
110
+ - Complex decision trees
111
+
112
+ This simplified system:
113
+ - **One way to find each resource** (not multiple smart strategies)
114
+ - **Clear read vs query decision** (raw rows vs aggregations)
115
+ - **Explicit model type handling** (default MAS, allow .job/.jobdef/.scr suffixes)
116
+ - **Consistent three-step workflow** (verify → execute → format)
117
+
118
+ ---
119
+
120
+ ## Migration Path
121
+
122
+ If you were using the old `.skills` folder:
123
+
124
+ | Old Skill | New Location |
125
+ |---|---|
126
+ | sas-find-resources-strategy | FIND-RESOURCE.md |
127
+ | sas-list-resource-strategy (libraries) | list-library/SKILL.md |
128
+ | sas-list-resource-strategy (tables) | list-tables/SKILL.md |
129
+ | sas-list-resource-strategy (models/jobs) | list-mas-job-jobdef/SKILL.md |
130
+ | sas-find-library-smart | FIND-RESOURCE.md (library section) |
131
+ | sas-list-tables-smart | READ-STRATEGY.md + list-tables tool |
132
+ | sas-read-strategy | READ-STRATEGY.md |
133
+ | sas-read-and-score-strategy | SCORE-STRATEGY.md (Option B) |
134
+ | sas-score-workflow-strategy | SCORE-STRATEGY.md |
135
+ | sas-request-classifier | REQUEST-ROUTING.md (classification section) |
136
+
137
+ ---
138
+
139
+ ## Questions?
140
+
141
+ Each strategy file has detailed examples, decision trees, and error handling guidance. Start with the strategy that matches your request type.
142
+
143
+ ---
144
+
145
+ ## Plugin Usage
146
+
147
+ The `.skills/` directory (one level up from here) is a Claude Code plugin. It bundles these skills, the agent instructions, and the MCP server configuration.
148
+
149
+ ### Plugin structure
150
+
151
+ ```
152
+ .skills/
153
+ ├── .claude-plugin/plugin.json ← plugin manifest
154
+ ├── .mcp.json ← MCP server config (stdio, npx)
155
+ ├── agents/
156
+ │ └── sas-score-mcp-serverjs-agent.md
157
+ └── skills/
158
+ ├── request-routing/SKILL.md
159
+ ├── find-library-server/SKILL.md
160
+ ├── find-resources/SKILL.md
161
+ ├── list-library/SKILL.md
162
+ ├── list-tables/SKILL.md
163
+ ├── list-mas-job-jobdef/SKILL.md
164
+ ├── read-strategy/SKILL.md
165
+ ├── score-strategy/SKILL.md
166
+ └── detail-strategy/SKILL.md
167
+ ```
168
+
169
+ ### Install (after npm install)
170
+
171
+ ```bash
172
+ # Point Claude Code at the plugin directory inside the installed package
173
+ /plugin install ./node_modules/@sassoftware/sas-score-mcp-serverjs/.skills
174
+
175
+ # Or from the git repo directly
176
+ /plugin install https://github.com/sassoftware/sas-score-mcp-serverjs --subdir .skills
177
+ ```
178
+
179
+ ### Required environment variables
180
+
181
+ | Variable | Default | Description |
182
+ |---|---|---|
183
+ | `VIYA_SERVER` | *(required)* | SAS Viya server URL, e.g. `https://my-viya.example.com` |
184
+ | `AUTHFLOW` | `oauth` | Auth flow: `oauth`, `code`, `sascli`, `token`, `bearer` |
185
+ | `CLIENTID` | `vscodemcp` | OAuth client ID registered on the Viya server |
186
+ | `CASSERVER` | `cas-shared-default` | CAS server name |
187
+ | `COMPUTECONTEXT` | `SAS Job Execution compute context` | Compute context name |
188
+
189
+ Set these in your shell or a `.env` file before starting Claude Code.
190
+
191
+ ### HTTP transport (remote/production deployments)
192
+
193
+ The default `.mcp.json` uses stdio (local npx). For a remotely deployed server (e.g. Docker on Azure), replace the entry in `.mcp.json` with:
194
+
195
+ ```json
196
+ {
197
+ "mcpServers": {
198
+ "sas-score-mcp-serverjs": {
199
+ "type": "http",
200
+ "url": "https://<your-deployed-host>/mcp"
201
+ }
202
+ }
203
+ }
204
+ ```
@@ -0,0 +1,316 @@
1
+ ---
2
+ name: detail-strategy
3
+ description: >
4
+ Use this strategy when the user requests information about a resource. This is a
5
+ 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
6
+ ---
7
+
8
+ # Detail Strategy
9
+
10
+ Use this strategy when the user requests information about a resource.
11
+
12
+ **Supported resource types**: MAS model, Job model, JobDef model, SCR model, or table.
13
+
14
+ 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?").
15
+
16
+ **Model**: If user just says "model X" without specifying type, default to MAS model (this is an explicit exception to the 'never invent' rule, but it is a predefined convention in SAS).
17
+
18
+ Verification rules
19
+ - Always verify the target resource exists using the appropriate `find-*` tool before attempting retrieval, except for SCR models (see Exceptions below).
20
+ - For tables, determine server (CAS vs SAS) during verification; if ambiguous, ask the user for the full `lib.table` or server.
21
+ - For models, strip suffixes such as `.mas`, `.job`, `.jobdef`,`.scr`, `.cas`, before lookup to avoid lookup failures.
22
+
23
+ Defaults & exceptions
24
+ - Default model type: MAS when the user says `model X` without specifying a type.
25
+ - If verification fails, inform the user and ask for corrected or more specific identifiers.
26
+
27
+ ---
28
+
29
+ ## Classification & Verification Process
30
+
31
+ ### Phase 1: Classify the Resource Type
32
+
33
+ Determine resource type from context/naming conventions.
34
+
35
+ **Dotted `a.b` notation rule**: parse `b` to determine type. If `b` is not in `{mas, job, jobdef, scr, sas, casl}`, treat `a.b` as a table where lib=`a`, table=`b`.
36
+
37
+ | Pattern | Resource Type |
38
+ |--------------------------|---------------|
39
+ | `X.mas` or `mas X` or `mas model X` | MAS model, name=X |
40
+ | `X.job` or `job X` or `job model X` | Job model, name=X |
41
+ | `X.jobdef` or `jobdef X` or `jobdef model X` | JobDef model, name=X |
42
+ | `X.scr` or `scr X` or `scr model X` | SCR model, name=X |
43
+ | `a.b` where b ∉ {mas,job,jobdef,scr,sas,casl} | **Table**: lib=a, name=b |
44
+ | `table X in library Y` | Table X in library Y |
45
+ | `model X` (no suffix) | Default to MAS model (explicit convention) |
46
+
47
+ If resource is ambiguous, ask user for clarification.
48
+
49
+ ### Phase 2: Verify Resource Exists
50
+
51
+ **IMPORTANT**: Strip the suffix if user included it, use base name for lookup (e.g. "churnRisk.mas" → "churnRisk") to avoid lookup failures.
52
+
53
+ Use find-resources skill to verify the resource exists
54
+
55
+ If verification fails, inform the user and ask for additional details or corrections.
56
+
57
+ ---
58
+
59
+
60
+ ### Phase 3: Get Details
61
+
62
+ ### Option A: MAS Model Details
63
+
64
+ **Trigger phrases**: "what inputs does mas model X need", "describe mas X", "show variables for model mas X, describe X.mas",
65
+ "mas model X metadata", "mas model X information", "describe model X" (default to MAS),
66
+ "what inputs does mas X need", "describe mas X"
67
+
68
+ **Tool**: `sas-score-mas-describe`
69
+
70
+ **Parameters**:
71
+ ```
72
+
73
+ sas-score-mas-describe({
74
+ model: "<model name>"
75
+ })
76
+ ```
77
+
78
+ **Returns**:
79
+ - Input variables (name, type, role)
80
+ - Output variables (name, type, possible_values)
81
+ - Model type
82
+ - Description
83
+
84
+ **Example**:
85
+ ```
86
+ User: "What inputs does mas model churnRisk need?"
87
+
88
+ 1. Find: sas-score-find-mas({ name: "churnRisk" })
89
+ 2. Get info: sas-score-mas-describe({ model: "churnRisk" })
90
+ 3. Return: { inputs: [...], outputs: [...], description: "..." }
91
+ ```
92
+
93
+ ---
94
+
95
+ ### Option B: SCR Model Details
96
+
97
+ **Trigger phrases**: "what does SCR model X need", "describe SCR model X", "scr model X inputs",
98
+ "scr model X schema", "what inputs does scr model X need", "describe scr X"
99
+
100
+ **Tool**: `sas-score-scr-describe`
101
+
102
+ **Parameters**:
103
+ ```
104
+ sas-score-scr-describe({
105
+ name: "<scr model name>"
106
+ })
107
+ ```
108
+
109
+ **Returns**:
110
+ - Input schema (variable names, types, required/optional)
111
+ - Output schema (prediction, probabilities, scores)
112
+ - Model metadata
113
+
114
+ **Example**:
115
+ ```
116
+ User: "Show inputs for SCR model loan"
117
+
118
+ 1. Get info: sas-score-scr-describe({ name: "loan" })
119
+ 2. Return: { inputs: [...], outputs: [...] }
120
+ ```
121
+
122
+ **Note**: SCR models do not require pre-verification (call scr-describe directly with the model name)
123
+
124
+ ---
125
+
126
+ ### Option C: Table Details
127
+
128
+ **Trigger phrases**: "what columns in table X", "describe table X", "show schema for table X", "table X structure", "table X metadata"
129
+
130
+ **Tool**: `sas-score-table-describe`
131
+
132
+ **Parameters**:
133
+ ```
134
+ sas-score-table-describe({
135
+ lib: "<library>",
136
+ table: "<table name>",
137
+ server: "<cas|sas>"
138
+ })
139
+ ```
140
+
141
+ **Returns**:
142
+ - Columns array (name, type, label, format, length)
143
+ - Table info (rowCount, fileSize, created, modified)
144
+
145
+ **Example**:
146
+ ```
147
+ User: "What columns are in the customers table in Public?"
148
+
149
+ 1. Find: sas-score-find-table({ lib: "Public", name: "customers", server: "cas" })
150
+ 2. Get info: sas-score-table-describe({ lib: "Public", table: "customers", server: "cas" })
151
+ 3. Return: { columns: [...], tableDescribe: {...} }
152
+ ```
153
+
154
+ ---
155
+ ### Option D: Job Model Details
156
+
157
+ **Trigger phrases**: "what inputs does job model X need", "describe job model X",
158
+ "show variables for job model X", "job model X metadata", "job model X information",
159
+ "what inputs does job X need", "describe job X"
160
+
161
+ **Tool**: `sas-score-job-describe`
162
+
163
+ **Parameters**:
164
+ ```
165
+ sas-score-job-describe({
166
+ name: "<model name>"
167
+ })
168
+ ```
169
+
170
+ **Returns**:
171
+ - Input variables (name, type, role)
172
+
173
+ **Example**:
174
+ ```
175
+ User: "What inputs does job model churnRisk need?"
176
+
177
+ 1. Find: use find-resources skill to job exists
178
+ 2. Get Details: sas-score-job-describe({ name: "churnRisk" })
179
+ 3. Return: { inputs: [...] }
180
+ ```
181
+
182
+ ### Option E: JobDef Model Details
183
+
184
+ **Trigger phrases**: "what inputs does jobdef model X need", "describe jobdef model X",
185
+ "jobdef model X metadata", "what inputs does jobdef X need", "describe jobdef X"
186
+
187
+ **Tool**: `sas-score-jobdef-describe`
188
+
189
+ **Parameters**:
190
+ ```
191
+ sas-score-jobdef-describe({
192
+ name: "<jobdef name>"
193
+ })
194
+ ```
195
+
196
+ **Example**:
197
+ ```
198
+ User: "What inputs does jobdef model myScorer need?"
199
+
200
+ 1. Find: sas-score-find-jobdef({ name: "myScorer" })
201
+ 2. Get info: sas-score-jobdef-describe({ name: "myScorer" })
202
+ 3. Return: { inputs: [...] }
203
+ ```
204
+
205
+ ---
206
+
207
+ ### Option F: SAS Program Model Details
208
+
209
+ SAS programs are treated as models — they accept parameters via `scenario` and produce scored outputs.
210
+
211
+ **Trigger phrases**: "describe sas program X", "what parameters does program X take",
212
+ "program model X info", "describe X.sas"
213
+
214
+ **Note**: SAS programs do not have a dedicated `describe` tool. If the program is wrapped in a Job, use `sas-score-job-describe`. Otherwise ask the user for parameter documentation.
215
+
216
+ ---
217
+
218
+
219
+ ## Decision Tree
220
+
221
+ ```
222
+ User requests information/details
223
+ ├─ About a MAS model?
224
+ │ → Verify: sas-score-find-mas
225
+ │ → Call: sas-score-mas-describe
226
+ │
227
+ ├─ About a SCR model?
228
+ │ → Call: sas-score-scr-describe (skip verification; use name directly)
229
+ │
230
+ ├─ About a Job model?
231
+ │ → Verify: sas-score-find-job
232
+ │ → Call: sas-score-job-describe
233
+ │
234
+ ├─ About a JobDef model?
235
+ │ → Verify: sas-score-find-jobdef
236
+ │ → Call: sas-score-jobdef-describe
237
+ │
238
+ └─ About a table?
239
+ → Verify: sas-score-find-table (determine CAS or SAS server)
240
+ → Call: sas-score-table-describe
241
+ ```
242
+
243
+ ---
244
+
245
+ ## Implementation Checklist
246
+
247
+ For each detail/information request:
248
+
249
+ - [ ] **Classify** resource type (MAS / Job / JobDef / SCR / table)
250
+ - [ ] **Verify** resource exists (use find-resources skill, except SCR)
251
+ - [ ] **Determine** server for tables (CAS or SAS)
252
+ - [ ] **Execute** appropriate detail tool
253
+ - [ ] **Format** results (column alignment, readable structure)
254
+ - [ ] **Append** Strategy Summary to response
255
+
256
+ ---
257
+
258
+ ## Response Format
259
+
260
+ Always append a **Strategy Summary** to responses (canonical template from `request-routing/SKILL.md`):
261
+
262
+ ```
263
+ ---
264
+ **Strategy Summary:**
265
+ - **Classification**: [Find / Read / Score / List / Describe]
266
+ - **Verification**: [Resources verified / skipped]
267
+ - **Tool(s)**: [Primary tool(s) invoked]
268
+ - **Decision**: [Server chosen, model type, mapping]
269
+ - **Next steps**: [Follow-ups or clarifications]
270
+ ```
271
+
272
+ ---
273
+
274
+ ## Error Recovery
275
+
276
+ If a request fails:
277
+
278
+ 1. **Resource not found** → Ask user to verify name/spelling
279
+ 2. **Server mismatch** → Re-verify server location with find-resources
280
+ 3. **Invalid name (SCR)** → Ask for correct SCR model name
281
+ 4. **Tool error** → Return error message verbatim and ask for clarification
282
+
283
+ ---
284
+
285
+ ## Examples
286
+
287
+ ### Example 1: Model Information
288
+
289
+ **User**: "Describe model creditScore"
290
+
291
+ **Workflow**:
292
+ 1. Classify: MAS model detail request
293
+ 2. Verify: Find model creditScore → Found ✓
294
+ 3. Execute: `sas-score-mas-describe({ model: "creditScore" })`
295
+ 4. Return: Model inputs, outputs, and description
296
+
297
+ ### Example 2: SCR Model Schema
298
+
299
+ **User**: "What inputs does the SCR loan model need?"
300
+
301
+ **Workflow**:
302
+ 1. Classify: SCR model detail request
303
+ 2. Execute: `sas-score-scr-describe({ name: "loan" })`
304
+ 3. Return: Input schema and output schema
305
+
306
+ ### Example 3: Table Columns
307
+
308
+ **User**: "Show columns for customers in Public"
309
+
310
+ **Workflow**:
311
+ 1. Classify: Table detail request
312
+ 2. Verify: verify table exists with find-resources skill
313
+ 3. Execute: `sas-score-table-describe({ lib: "Public", table: "customers", server: "$server" })` where $server is determined from verification step
314
+ 4. Return: Column names, types, and table metadata
315
+
316
+