@sassoftware/sas-score-mcp-serverjs 1.0.1-32 → 1.0.1-34
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.
- package/.skills/agents/sas-score-mcp-serverjs-agent.md +16 -179
- package/.skills/copilot-instructions.md +38 -255
- package/.skills/decision-trees/_primitives.yaml +8 -0
- package/.skills/decision-trees/job.yaml +33 -0
- package/.skills/decision-trees/jobdef.yaml +33 -0
- package/.skills/decision-trees/mas.yaml +35 -0
- package/.skills/decision-trees/scr.yaml +16 -0
- package/.skills/decision-trees/table.yaml +57 -0
- package/.skills/skills/README.md +1 -1
- package/.skills/skills/detail-strategy/SKILL.md +9 -10
- package/.skills/skills/find-resources/SKILL.md +13 -7
- package/.skills/skills/list-resource/SKILL.md +7 -0
- package/.skills/skills/read-strategy/SKILL.md +6 -1
- package/.skills/skills/request-routing/SKILL.md +72 -98
- package/.skills/skills/score-strategy/SKILL.md +5 -0
- package/package.json +1 -1
- package/scripts/plot_msrp_usa.py +49 -49
- package/src/toolHelpers/_findMas.js +11 -11
- package/src/toolHelpers/_findScr.js +31 -0
- package/src/toolSet/devaScore.js +5 -5
- package/src/toolSet/findJob.js +9 -6
- package/src/toolSet/findJobdef.js +7 -7
- package/src/toolSet/findLibrary.js +7 -7
- package/src/toolSet/findMas.js +6 -6
- package/src/toolSet/findTable.js +6 -6
- package/src/toolSet/getEnv.js +6 -6
- package/src/toolSet/jobInfo.js +4 -4
- package/src/toolSet/jobdefInfo.js +4 -4
- package/src/toolSet/listJobdefs.js +5 -5
- package/src/toolSet/listJobs.js +5 -5
- package/src/toolSet/listLibraries.js +4 -4
- package/src/toolSet/listMas.js +4 -4
- package/src/toolSet/listTables.js +5 -5
|
@@ -1,190 +1,27 @@
|
|
|
1
1
|
---
|
|
2
|
+
---
|
|
2
3
|
name: sas-score-mcp-serverjs-agent
|
|
3
4
|
description: >
|
|
4
|
-
Unified orchestration agent for SAS Viya.
|
|
5
|
-
|
|
6
|
-
2. Execute action
|
|
7
|
-
3. Merge/format results
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
# SAS Viya Unified Router
|
|
11
|
-
|
|
12
|
-
**Default Agent Mode**: Use this workflow for all SAS Viya requests.
|
|
13
|
-
|
|
14
|
-
## Operating Principle
|
|
15
|
-
|
|
16
|
-
Every SAS Viya request follows the same three-step workflow:
|
|
17
|
-
|
|
18
|
-
1. **VERIFY**: Use FIND-RESOURCE to verify target resources exist
|
|
19
|
-
2. **EXECUTE**: Use appropriate execution tool (READ, SCORE, etc.)
|
|
20
|
-
3. **FORMAT**: Merge results and return to user
|
|
21
|
-
|
|
22
|
-
---
|
|
23
|
-
|
|
24
|
-
## Request Classification
|
|
25
|
-
|
|
26
|
-
When you receive a SAS Viya request, classify it into one of these categories:
|
|
27
|
-
|
|
28
|
-
| Category | Trigger Phrases | Primary Strategy | Tool |
|
|
29
|
-
|---|---|---|---|
|
|
30
|
-
| **Find Resource** | "find", "does X exist", "locate", "verify" | FIND-RESOURCE | find-* tools |
|
|
31
|
-
| **Read Data** | "read", "show records", "fetch rows", "query", "how many", "count by", "average" | READ-STRATEGY | read-table, sas-query |
|
|
32
|
-
| **Score** | "score", "predict", "run model", "forecast" | SCORE-STRATEGY | mas-score, run-jobdef, scr-score |
|
|
33
|
-
| **List Discovery** | "list", "show all", "browse" | Use list-* tools directly | list-* tools |
|
|
34
|
-
|
|
35
|
-
---
|
|
36
|
-
|
|
37
|
-
## Workflow Rules
|
|
38
|
-
|
|
39
|
-
### Rule 1: Always Verify Before Executing
|
|
40
|
-
|
|
41
|
-
Exception: SCR models (no pre-verification needed)
|
|
42
|
-
|
|
43
|
-
```
|
|
44
|
-
User request
|
|
45
|
-
↓
|
|
46
|
-
Does request involve execution (score, read, etc.)?
|
|
47
|
-
├─ YES → Verify resources first (FIND-RESOURCE)
|
|
48
|
-
├─ NO → Return result directly
|
|
49
|
-
└─ EXCEPTION: SCR models can score without verification
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
### Rule 2: Determine Server for Tables
|
|
53
|
-
|
|
54
|
-
Every table access must include server determination:
|
|
55
|
-
- CAS: Caslib.table (Casuser, Public, Samples, etc.)
|
|
56
|
-
- SAS: LIBREF.table (SASHELP, WORK, SASUUSER, etc.)
|
|
57
|
-
|
|
58
|
-
Use FIND-RESOURCE to determine server if ambiguous.
|
|
59
|
-
|
|
60
|
-
### Rule 3: Merge Scenario and Results
|
|
61
|
-
|
|
62
|
-
For scoring requests:
|
|
63
|
-
- Inline scenario: Merge scenario inputs with predictions
|
|
64
|
-
- Table rows: Merge row data with predictions
|
|
65
|
-
|
|
66
|
-
---
|
|
67
|
-
|
|
68
|
-
## Decision Trees
|
|
69
|
-
|
|
70
|
-
### Decision 1: What does the user want?
|
|
71
|
-
|
|
72
|
-
```
|
|
73
|
-
User request
|
|
74
|
-
├─ Find resource?
|
|
75
|
-
│ → Use FIND-RESOURCE strategy
|
|
76
|
-
│ → Tool: appropriate find-* tool
|
|
77
|
-
│
|
|
78
|
-
├─ Read/Query data?
|
|
79
|
-
│ → Use READ-STRATEGY
|
|
80
|
-
│ → Tool: sas-score-read-table or sas-score-sas-query
|
|
81
|
-
│
|
|
82
|
-
├─ Score/Predict?
|
|
83
|
-
│ → Use SCORE-STRATEGY
|
|
84
|
-
│ → Tool: mas-score, run-jobdef, scr-score
|
|
85
|
-
│
|
|
86
|
-
└─ List/Browse resources?
|
|
87
|
-
→ Use list-* tools directly
|
|
88
|
-
→ Tool: list-models, list-jobs, list-tables, etc.
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
### Decision 2: For Score Requests - What's the Input?
|
|
92
|
-
|
|
93
|
-
```
|
|
94
|
-
Score request
|
|
95
|
-
├─ Inline scenario (a=1, b=2)?
|
|
96
|
-
│ → Verify model exists
|
|
97
|
-
│ → Execute: mas-score or run-jobdef
|
|
98
|
-
│ → Return: merged scenario + predictions
|
|
99
|
-
│
|
|
100
|
-
└─ Table rows?
|
|
101
|
-
→ Verify model exists
|
|
102
|
-
→ Verify table exists (determine server)
|
|
103
|
-
→ Read rows from table
|
|
104
|
-
→ Score each row
|
|
105
|
-
→ Return: merged rows + predictions
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
---
|
|
109
|
-
|
|
110
|
-
## Implementation Checklist
|
|
111
|
-
|
|
112
|
-
For each SAS Viya request:
|
|
113
|
-
|
|
114
|
-
- [ ] **Classify** the request (find/read/score/list)
|
|
115
|
-
- [ ] **Verify** resources exist (use FIND-RESOURCE)
|
|
116
|
-
- [ ] **Execute** the action with correct parameters
|
|
117
|
-
- [ ] **Handle errors** (ask for clarification if needed)
|
|
118
|
-
- [ ] **Format** results (merge, structure, present)
|
|
119
|
-
- [ ] **Append Strategy Summary** to response
|
|
120
|
-
|
|
121
|
-
---
|
|
122
|
-
|
|
123
|
-
## Error Recovery
|
|
124
|
-
|
|
125
|
-
If a request fails:
|
|
126
|
-
|
|
127
|
-
1. **Resource not found** → Ask user to verify name/spelling
|
|
128
|
-
2. **Server mismatch** → Re-verify server location with FIND-RESOURCE
|
|
129
|
-
3. **Schema mismatch** → Ask for column/variable mapping
|
|
130
|
-
4. **Empty result** → Ask user to adjust filter/criteria
|
|
131
|
-
5. **Execution error** → Return tool error message verbatim
|
|
132
|
-
|
|
5
|
+
Unified orchestration agent for scoring in SAS Viya.
|
|
6
|
+
Follow the canonical SKILL at [skills/request-routing/SKILL.md](skills/request-routing/SKILL.md).
|
|
133
7
|
---
|
|
134
8
|
|
|
135
|
-
|
|
9
|
+
# SAS Viya Unified Router
|
|
136
10
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
```
|
|
140
|
-
---
|
|
141
|
-
|
|
142
|
-
**Strategy Summary:**
|
|
143
|
-
- **Classification**: [Request type identified]
|
|
144
|
-
- **Verification**: [Resources verified or skipped]
|
|
145
|
-
- **Tool Used**: [Primary tool(s) invoked]
|
|
146
|
-
- **Decision**: [Key routing decision made]
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
---
|
|
11
|
+
**Default Agent Mode**: Use the request-strategy strategy for all requests.
|
|
150
12
|
|
|
151
|
-
|
|
13
|
+
Agent defaults
|
|
14
|
+
- Append the **Strategy Summary** to every response.
|
|
152
15
|
|
|
153
|
-
|
|
154
|
-
|
|
16
|
+
Behavior (high-level)
|
|
17
|
+
- Classification → Verification → Execution → Formatting (Strategy Summary appended).
|
|
18
|
+
- For Read+Score flows, follow the SKILL's Combined Read+Score steps.
|
|
155
19
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
### Example 2: Read + Aggregate
|
|
163
|
-
**User**: "how many customers by region from Public"
|
|
164
|
-
|
|
165
|
-
**Workflow**:
|
|
166
|
-
1. Classify: Read request, analytical query
|
|
167
|
-
2. Verify: Find table customers in Public → CAS ✓
|
|
168
|
-
3. Execute: `sas-score-sas-query({ table: "Public.customers", query: "count by region", sql: "..." })`
|
|
169
|
-
4. Format: Return grouped counts
|
|
170
|
-
|
|
171
|
-
### Example 3: Score Table Rows
|
|
172
|
-
**User**: "score all active customers with model risk_model"
|
|
173
|
-
|
|
174
|
-
**Workflow**:
|
|
175
|
-
1. Classify: Score request, table rows
|
|
176
|
-
2. Verify: Find model risk_model → MAS ✓, Find table customers in Public → CAS ✓
|
|
177
|
-
3. Execute:
|
|
178
|
-
- Read rows: `sas-score-read-table({ ... where: "status='active'" })`
|
|
179
|
-
- Score: `sas-score-mas-score({ model: "risk_model", scenario: {each row} })`
|
|
180
|
-
4. Format: Return rows with risk_score appended
|
|
181
|
-
|
|
182
|
-
---
|
|
20
|
+
Implementation checklist (agent-level)
|
|
21
|
+
- Classify request and consult SKILL for decision-making.
|
|
22
|
+
- Invoke find-* tools for verification
|
|
23
|
+
- Call execution tools mapped in the SKILL.
|
|
24
|
+
- Surface errors verbatim and ask targeted clarification questions when needed.
|
|
183
25
|
|
|
184
|
-
|
|
26
|
+
See the canonical router for the full mapping, rules, examples, and Strategy Summary template: [skills/request-routing/SKILL.md](skills/request-routing/SKILL.md)
|
|
185
27
|
|
|
186
|
-
- Keep verification separate from execution
|
|
187
|
-
- Always determine server for CAS/SAS tables
|
|
188
|
-
- Default model type to MAS if not specified
|
|
189
|
-
- Skip SCR pre-verification (score directly)
|
|
190
|
-
- Ask clarifying questions for ambiguous terms
|
|
@@ -1,265 +1,48 @@
|
|
|
1
|
-
# GitHub Copilot
|
|
1
|
+
# GitHub Copilot — SAS Viya (concise agent guide)
|
|
2
2
|
|
|
3
|
-
|
|
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
4
|
|
|
5
|
+
**Core principle (single sentence):** Verify resources, execute with the mapped tool, and format results.
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
## Canonical workflow
|
|
8
|
+
- Verify: confirm resources exist using `find-*` tools (except SCR and list operations).
|
|
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.
|
|
7
11
|
|
|
8
|
-
|
|
9
|
-
1. Identify the user's intent (Find, Read, Score, Run, List)
|
|
10
|
-
2. Identify the resources involved (libraries, tables, models, jobs, jobdefs, scr, src)
|
|
11
|
-
3. Verify resources exist using find-resources tools
|
|
12
|
-
4. Select the appropriate tool based on intent and resource type
|
|
13
|
-
5. Execute and format the result
|
|
12
|
+
Note: the five-step phrasing (Identify → Verify → Select → Execute → Format) maps to the same implementation; prefer the three-step mental model when implementing.
|
|
14
13
|
|
|
14
|
+
## Agent defaults
|
|
15
|
+
- Default model type: MAS (unless user specifies `.job`, `.jobdef`, or `.scr`).
|
|
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.
|
|
15
19
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
1. **IDENTIFY** — Determine the user's intent and the resources involved
|
|
23
|
-
2. **VERIFY** — Use find-resources to verify target resources exist
|
|
24
|
-
3. **SELECT** — Choose the appropriate tool based on intent and resource type
|
|
25
|
-
4. **EXECUTE** — Use the appropriate execution tool (sas-score-read-table, sas-score-mas-score, sas-score-run-jobdef, sas-score-run-job, sas-score-scr-score, sas-score-run-sas-program, etc.)
|
|
26
|
-
5. **FORMAT** — Merge results and return to user
|
|
27
|
-
|
|
28
|
-
### Request Classification
|
|
29
|
-
|
|
30
|
-
When you receive a SAS request, classify it using request-routing skill:
|
|
31
|
-
|
|
32
|
-
| Type | Trigger | Strategy | Tool |
|
|
33
|
-
|---|---|---|---|
|
|
34
|
-
| Find | "find", "locate", "exists" | find-resources | sas-score-find-library, sas-score-find-table, etc. |
|
|
35
|
-
| Read | "read", "show", "fetch", "query", "how many", "count by" | read-strategy | sas-score-read-table, sas-score-sas-query |
|
|
36
|
-
| Score | "score", "predict", "run model", "run mas model", "run job model", "run jobdef model", "run scr model" | score-strategy | sas-score-mas-score, sas-score-run-job, sas-score-run-jobdef, sas-score-scr-score, sas-score-run-sas-program |
|
|
37
|
-
| List | "list", "show all" | — | sas-score-list-libraries, sas-score-list-tables, sas-score-list-mas (MAS models), sas-score-list-jobs (job models), sas-score-list-jobdefs (jobdef models) |
|
|
38
|
-
| Describe | "describe", "what inputs", "show schema", "metadata", "information" | detail-strategy | sas-score-mas-info, sas-score-job-info, sas-score-jobdef-info, sas-score-scr-info, sas-score-table-info |
|
|
39
|
-
|
|
40
|
-
---
|
|
41
|
-
|
|
42
|
-
## Key Principles
|
|
43
|
-
|
|
44
|
-
### 1. Always Verify Before Executing
|
|
45
|
-
|
|
46
|
-
**Exception** - List operations do not require pre-verification. They can be executed directly to explore available resources.
|
|
47
|
-
|
|
48
|
-
```
|
|
49
|
-
Verify resources exist (find-resources)
|
|
50
|
-
↓
|
|
51
|
-
Execute action (sas-score-read-table, sas-score-mas-score, sas-score-run-jobdef, sas-score-run-job, sas-score-scr-score, sas-score-run-sas-program, etc.)
|
|
52
|
-
↓
|
|
53
|
-
Merge and format results
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
### 2. Determine Server for Tables
|
|
57
|
-
|
|
58
|
-
Every table operation must explicitly determine whether the table is in CAS or SAS:
|
|
59
|
-
- CAS tables: Caslib.table (Casuser, Public, Samples, Formats, etc.)
|
|
60
|
-
- SAS tables: LIBREF.table (SASHELP, WORK, SASUSER, etc.)
|
|
61
|
-
|
|
62
|
-
Use find-resources skill to determine server if not specified by user.
|
|
63
|
-
|
|
64
|
-
**DO NOT** use list-resources to find a resource. This is prone to errors and inefficient. Always use find-resources for verification.
|
|
65
|
-
|
|
66
|
-
### 3. Explicit Model Type
|
|
67
|
-
|
|
68
|
-
Model type can be expressed as a **dot-suffix** (`X.mas`) or as an **adjective form** (`mas model X`). Both are equivalent and should be handled the same way:
|
|
69
|
-
|
|
70
|
-
```
|
|
71
|
-
# Dot-suffix form
|
|
72
|
-
score with model X → MAS (default)
|
|
73
|
-
score with model X.mas → MAS
|
|
74
|
-
score with model X.job → Job
|
|
75
|
-
score with model X.jobdef → JobDef
|
|
76
|
-
score with model X.scr → SCR (no pre-verification)
|
|
77
|
-
run model X → MAS (default)
|
|
78
|
-
run model X.mas → MAS
|
|
79
|
-
run model X.job → Job
|
|
80
|
-
run model X.jobdef → JobDef
|
|
81
|
-
run model X.scr → SCR (no pre-verification)
|
|
82
|
-
|
|
83
|
-
# Adjective form (equivalent)
|
|
84
|
-
score with mas model X → MAS
|
|
85
|
-
score with job model X → Job
|
|
86
|
-
score with jobdef model X → JobDef
|
|
87
|
-
score with scr model X → SCR (no pre-verification)
|
|
88
|
-
run mas model X → MAS
|
|
89
|
-
run job model X → Job
|
|
90
|
-
run jobdef model X → JobDef
|
|
91
|
-
run scr model X → SCR (no pre-verification)
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
### 4. No Invention
|
|
95
|
-
|
|
96
|
-
Never invent resource names, identifiers, servers, or model types. Always verify or ask.
|
|
97
|
-
|
|
98
|
-
---
|
|
99
|
-
|
|
100
|
-
## Ambiguous Terms
|
|
101
|
-
|
|
102
|
-
These terms are overloaded in SAS and must be clarified:
|
|
103
|
-
|
|
104
|
-
- **model**: Can refer to a MAS model, Job model, JobDef model, or SCR model. Disambiguate using the **adjective form** (`mas model`, `job model`, `jobdef model`, `scr model`) or a **dot-suffix** (`.mas`, `.job`, `.jobdef`, `.scr`). Default to MAS when no type is given.
|
|
105
|
-
- **score/scoring/run**: Running a scoring model on data, or running a SAS program?
|
|
106
|
-
- **table**: CAS table or SAS dataset? Which library?
|
|
107
|
-
- **resource**: Library, table, model (which type?), job, jobdef, scr?
|
|
108
|
-
- **read/query**: Raw row read or aggregation?
|
|
109
|
-
|
|
110
|
-
When ambiguous, ask one focused clarifying question.
|
|
111
|
-
|
|
112
|
-
---
|
|
113
|
-
|
|
114
|
-
## Strategy Reference
|
|
115
|
-
|
|
116
|
-
See the strategies folder:
|
|
117
|
-
|
|
118
|
-
- **request-routing** — Universal three-step workflow + examples
|
|
119
|
-
- **find-resources** — How to verify resources exist
|
|
120
|
-
- **read-strategy** — How to read/query tables
|
|
121
|
-
- **score-strategy** — How to score/predict
|
|
122
|
-
- **list-resource** — How to list resources
|
|
123
|
-
- **detail-strategy** — How to retrieve details about a resource
|
|
124
|
-
- **sas-score-mcp-serverjs-agent** — Main orchestration agent
|
|
125
|
-
|
|
126
|
-
---
|
|
127
|
-
|
|
128
|
-
## Response Format
|
|
20
|
+
## Canonical tool mappings (short)
|
|
21
|
+
- Find: `sas-score-find-library`, `sas-score-find-table`, `sas-score-find-mas`, `sas-score-find-job`, `sas-score-find-jobdef`
|
|
22
|
+
- Read / Query: `sas-score-read-table`, `sas-score-sas-query`
|
|
23
|
+
- Score / Run: `sas-score-mas-score`, `sas-score-run-job`, `sas-score-run-jobdef`, `sas-score-scr-score`
|
|
24
|
+
- List: `sas-score-list-libraries`, `sas-score-list-tables`, `sas-score-list-mas`, `sas-score-list-jobs`, `sas-score-list-jobdefs`
|
|
25
|
+
- Detail: `sas-score-mas-info`, `sas-score-job-info`, `sas-score-scr-info`, `sas-score-table-info`
|
|
129
26
|
|
|
130
|
-
|
|
131
|
-
After completing a SAS Viya request, append a brief **Strategy Summary**:
|
|
27
|
+
If a project-specific execution tool exists (for example a `run-sas-program` helper), document it in the `skills/` folder and keep this file minimal.
|
|
132
28
|
|
|
133
|
-
|
|
29
|
+
## Strategy Summary (append to replies)
|
|
134
30
|
---
|
|
135
|
-
|
|
136
|
-
**Strategy Summary:**
|
|
137
|
-
- **Classification**: [Request type you identified]
|
|
138
|
-
- **Verification**: [Resources verified or verification skipped]
|
|
139
|
-
- **Tool Used**: [Primary tool(s) invoked]
|
|
140
|
-
- **Routing Decision**: [Why you chose this path]
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
Example:
|
|
144
|
-
```
|
|
145
31
|
**Strategy Summary:**
|
|
146
|
-
- **Classification**: Score
|
|
147
|
-
- **Verification**:
|
|
148
|
-
- **Tool
|
|
149
|
-
- **
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
---
|
|
165
|
-
|
|
166
|
-
## Examples
|
|
167
|
-
|
|
168
|
-
### Example 1: Score Inline Scenario
|
|
169
|
-
**User**: "score a=1, b=2 with model simplejob.job"
|
|
170
|
-
|
|
171
|
-
**Process**:
|
|
172
|
-
1. Classify: Score request, inline scenario, job type
|
|
173
|
-
2. Verify: Find job simplejob → Found ✓
|
|
174
|
-
3. Execute: `sas-score-run-jobdef({ name: "simplejob", scenario: { a: 1, b: 2 } })`
|
|
175
|
-
4. Result: `{ a: 1, b: 2, c: 3 }`
|
|
176
|
-
|
|
177
|
-
### Example 2: Query with Aggregation
|
|
178
|
-
**User**: "average MSRP by make for cars from USA in sasshelp.cars"
|
|
179
|
-
|
|
180
|
-
**Process**:
|
|
181
|
-
1. Classify: Read request, analytical query
|
|
182
|
-
2. Verify: SASHELP is default SAS library ✓
|
|
183
|
-
3. Execute: `sas-score-sas-query({ table: "SASHELP.cars", query: "average MSRP by make where origin='USA'", ... })`
|
|
184
|
-
4. Result: Aggregated data by make
|
|
185
|
-
|
|
186
|
-
### Example 3: Read Rows
|
|
187
|
-
**User**: "read first 20 customers from Public.customers"
|
|
188
|
-
|
|
189
|
-
**Process**:
|
|
190
|
-
1. Classify: Read request, raw row read
|
|
191
|
-
2. Verify: Find table customers in Public → CAS ✓
|
|
192
|
-
3. Execute: `sas-score-read-table({ lib: "Public", table: "customers", server: "cas", limit: 20 })`
|
|
193
|
-
4. Result: 20 customer rows
|
|
194
|
-
|
|
195
|
-
### Example 4: Score Table Rows
|
|
196
|
-
**User**: "score all active customers in Public.customers with model risk_model"
|
|
197
|
-
|
|
198
|
-
**Process**:
|
|
199
|
-
1. Classify: Score request, table rows
|
|
200
|
-
2. Verify: Find model risk_model → MAS ✓, Find table customers → CAS ✓
|
|
201
|
-
3. Execute:
|
|
202
|
-
- Read: `sas-score-read-table({ where: "status='active'" })`
|
|
203
|
-
- Score: `sas-score-mas-score({ model: "risk_model", scenario: {each row} })`
|
|
204
|
-
4. Result: Rows with risk_score appended
|
|
205
|
-
|
|
206
|
-
---
|
|
207
|
-
|
|
208
|
-
## Quick Reference: Tools
|
|
209
|
-
|
|
210
|
-
| Category | Tool | Purpose |
|
|
211
|
-
|---|---|---|
|
|
212
|
-
| **Find** | sas-score-find-library | Verify library exists |
|
|
213
|
-
| | sas-score-find-table | Verify table exists + determine server |
|
|
214
|
-
| | sas-score-find-model | Verify MAS model exists |
|
|
215
|
-
| | sas-score-find-job | Verify job exists |
|
|
216
|
-
| | sas-score-find-jobdef | Verify jobdef exists |
|
|
217
|
-
| **Read** | sas-score-read-table | Get raw rows from table |
|
|
218
|
-
| | sas-score-sas-query | Query with aggregations |
|
|
219
|
-
| **Score** | sas-score-mas-score | Score with MAS model |
|
|
220
|
-
| | sas-score-run-jobdef | Run job or jobdef |
|
|
221
|
-
| | sas-score-scr-score | Score with SCR model |
|
|
222
|
-
| **List** | sas-score-list-libraries | Browse all libraries |
|
|
223
|
-
| | sas-score-list-tables | Browse tables in library |
|
|
224
|
-
| | sas-score-list-models | Browse MAS models |
|
|
225
|
-
| | sas-score-list-jobs | Browse jobs |
|
|
226
|
-
| | sas-score-list-jobdefs | Browse jobdefs |
|
|
227
|
-
| **Detail** | sas-score-model-info | Get MAS model details |
|
|
228
|
-
| | sas-score-job-info | Get Job model details |
|
|
229
|
-
| | sas-score-scr-info | Get SCR model details |
|
|
230
|
-
| | sas-score-table-info | Get table details |
|
|
231
|
-
|
|
232
|
-
---
|
|
233
|
-
|
|
234
|
-
## When to Ask for Clarification
|
|
235
|
-
|
|
236
|
-
Ask one focused question if:
|
|
237
|
-
- [ ] Resource name is missing or ambiguous
|
|
238
|
-
- [ ] Model type is not specified (.mas/.job/.jobdef/.scr)
|
|
239
|
-
- [ ] Table library is not specified
|
|
240
|
-
- [ ] Request involves "model" without type context
|
|
241
|
-
- [ ] User is asking for aggregation but column mapping is unclear
|
|
242
|
-
- [ ] Scoring inputs don't match model signature
|
|
243
|
-
|
|
244
|
-
**Do NOT guess.** Ambiguity is better resolved than guessed.
|
|
245
|
-
|
|
246
|
-
---
|
|
247
|
-
|
|
248
|
-
## When to Verify
|
|
249
|
-
|
|
250
|
-
**Always verify before executing**, except:
|
|
251
|
-
- List operations (list-* tools don't need pre-verification)
|
|
252
|
-
- SCR scoring (SCR can score without pre-check)
|
|
253
|
-
|
|
254
|
-
---
|
|
255
|
-
|
|
256
|
-
## Summary
|
|
257
|
-
|
|
258
|
-
This is a **three-step, reliable system**:
|
|
259
|
-
|
|
260
|
-
1. **Classify** the request (find/read/score/list)
|
|
261
|
-
2. **Verify** resources exist (except list and SCR)
|
|
262
|
-
3. **Execute** with the right tool
|
|
263
|
-
4. **Format** results + append Strategy Summary
|
|
264
|
-
|
|
265
|
-
No ambiguity. No guessing. No invented resource names.
|
|
32
|
+
- **Classification**: [Find / Read / Score / List / Describe]
|
|
33
|
+
- **Verification**: [Resources verified / skipped]
|
|
34
|
+
- **Tool(s)**: [Primary tool(s) invoked]
|
|
35
|
+
- **Decision**: [Server chosen, model type, mapping]
|
|
36
|
+
- **Next steps**: [Follow-ups or clarifications]
|
|
37
|
+
|
|
38
|
+
## When to ask a clarification (one focused question)
|
|
39
|
+
- Missing or ambiguous resource name
|
|
40
|
+
- Model type not specified (`.mas` / `.job` / `.jobdef` / `.scr`)
|
|
41
|
+
- Table library or server not specified
|
|
42
|
+
- Column-to-model-input mapping is unclear
|
|
43
|
+
|
|
44
|
+
## References
|
|
45
|
+
- Canonical router and examples: `skills/request-routing/SKILL.md`
|
|
46
|
+
- Agent defaults and orchestration: `agents/sas-score-mcp-serverjs-agent.md`
|
|
47
|
+
|
|
48
|
+
Keep this file short. Use the SKILLs for decision trees, examples, and edge-case rules.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
primitives:
|
|
3
|
+
parse-lib-table:
|
|
4
|
+
doc: "Split a lib.table reference into lib and table parts."
|
|
5
|
+
verify-resource:
|
|
6
|
+
doc: "Standardized wrapper for calling find-* tools and surfacing errors."
|
|
7
|
+
format-merge-prediction:
|
|
8
|
+
doc: "Primitive to merge prediction output into input rows."
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
resource: "job"
|
|
3
|
+
description: "Decision tree for Jobs: list, find, run"
|
|
4
|
+
intents:
|
|
5
|
+
list:
|
|
6
|
+
exec:
|
|
7
|
+
tool: "list-jobs"
|
|
8
|
+
args:
|
|
9
|
+
start: 1
|
|
10
|
+
limit: 10
|
|
11
|
+
format: "list of jobs"
|
|
12
|
+
find:
|
|
13
|
+
parse:
|
|
14
|
+
name: "$name"
|
|
15
|
+
exec:
|
|
16
|
+
tool: "find-job"
|
|
17
|
+
args:
|
|
18
|
+
name: "$name"
|
|
19
|
+
format: "find response"
|
|
20
|
+
run:
|
|
21
|
+
parse:
|
|
22
|
+
name: "$name"
|
|
23
|
+
scenario: "$scenario"
|
|
24
|
+
verify:
|
|
25
|
+
tool: "find-job"
|
|
26
|
+
args:
|
|
27
|
+
name: "$name"
|
|
28
|
+
exec:
|
|
29
|
+
tool: "sas-score-run-job"
|
|
30
|
+
args:
|
|
31
|
+
name: "$name"
|
|
32
|
+
scenario: "$scenario"
|
|
33
|
+
format: "job run output"
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
resource: "jobdef"
|
|
3
|
+
description: "Decision tree for JobDefs: list, find, run"
|
|
4
|
+
intents:
|
|
5
|
+
list:
|
|
6
|
+
exec:
|
|
7
|
+
tool: "list-jobdefs"
|
|
8
|
+
args:
|
|
9
|
+
start: 1
|
|
10
|
+
limit: 10
|
|
11
|
+
format: "list of jobdefs"
|
|
12
|
+
find:
|
|
13
|
+
parse:
|
|
14
|
+
name: "$name"
|
|
15
|
+
exec:
|
|
16
|
+
tool: "find-jobdef"
|
|
17
|
+
args:
|
|
18
|
+
name: "$name"
|
|
19
|
+
format: "find response"
|
|
20
|
+
run:
|
|
21
|
+
parse:
|
|
22
|
+
name: "$name"
|
|
23
|
+
scenario: "$scenario"
|
|
24
|
+
verify:
|
|
25
|
+
tool: "find-jobdef"
|
|
26
|
+
args:
|
|
27
|
+
name: "$name"
|
|
28
|
+
exec:
|
|
29
|
+
tool: "sas-score-run-jobdef"
|
|
30
|
+
args:
|
|
31
|
+
name: "$name"
|
|
32
|
+
scenario: "$scenario"
|
|
33
|
+
format: "jobdef run output"
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
resource: "mas"
|
|
3
|
+
description: "Decision tree for MAS models: list, find, score"
|
|
4
|
+
intents:
|
|
5
|
+
list:
|
|
6
|
+
parse:
|
|
7
|
+
scope: "$scope" # optional scope/namespace
|
|
8
|
+
exec:
|
|
9
|
+
tool: "list-mas"
|
|
10
|
+
args:
|
|
11
|
+
start: 1
|
|
12
|
+
limit: 10
|
|
13
|
+
format: "list of MAS models"
|
|
14
|
+
find:
|
|
15
|
+
parse:
|
|
16
|
+
model: "$model"
|
|
17
|
+
exec:
|
|
18
|
+
tool: "find-mas"
|
|
19
|
+
args:
|
|
20
|
+
name: "$model"
|
|
21
|
+
format: "find response"
|
|
22
|
+
score:
|
|
23
|
+
parse:
|
|
24
|
+
model: "$model"
|
|
25
|
+
scenario: "$scenario"
|
|
26
|
+
verify:
|
|
27
|
+
tool: "find-mas"
|
|
28
|
+
args:
|
|
29
|
+
name: "$model"
|
|
30
|
+
exec:
|
|
31
|
+
tool: "sas-score-mas-score"
|
|
32
|
+
args:
|
|
33
|
+
model: "$model"
|
|
34
|
+
scenario: "$scenario"
|
|
35
|
+
format: "merge prediction with input"
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
resource: "scr"
|
|
3
|
+
description: "Decision tree for SCR (external) models. Skip pre-verification; require valid endpoint."
|
|
4
|
+
intents:
|
|
5
|
+
score:
|
|
6
|
+
parse:
|
|
7
|
+
url: "$url"
|
|
8
|
+
scenario: "$scenario"
|
|
9
|
+
verify:
|
|
10
|
+
skip: true
|
|
11
|
+
exec:
|
|
12
|
+
tool: "sas-score-scr-score"
|
|
13
|
+
args:
|
|
14
|
+
url: "$url"
|
|
15
|
+
scenario: "$scenario"
|
|
16
|
+
format: "merge prediction with input"
|