@sassoftware/sas-score-mcp-serverjs 0.4.1-17 → 0.4.1-19
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/cli.js +1 -1
- package/package.json +1 -1
- package/skills/sas-read-strategy/SKILL.md +41 -22
- package/src/toolSet/findTable.js +2 -2
package/cli.js
CHANGED
|
@@ -214,7 +214,7 @@ if (args.values.version) {
|
|
|
214
214
|
console.error(`[Note] MCP client set to: ${process.env.CLIENT}`);
|
|
215
215
|
|
|
216
216
|
let client = process.env.CLIENT;
|
|
217
|
-
if (client
|
|
217
|
+
if (client !== 'none') {
|
|
218
218
|
let destdir = '.' + client;
|
|
219
219
|
let skillsDest = join(os.homedir(), destdir,'skills');
|
|
220
220
|
const skillsSrc = join(__dirname, 'skills');
|
package/package.json
CHANGED
|
@@ -15,20 +15,24 @@ of the data operation. Determines which server contains the data and which retri
|
|
|
15
15
|
|
|
16
16
|
## Determine the server location
|
|
17
17
|
|
|
18
|
-
Before retrieving data,
|
|
18
|
+
Before retrieving data, locate the table and determine which server contains it:
|
|
19
19
|
|
|
20
|
-
**
|
|
21
|
-
- Use `sas-find-library-smart` skill to check the library in CAS first, then SAS if needed
|
|
22
|
-
- This establishes the correct server and uppercase convention for SAS libraries
|
|
23
|
-
- Informs the user which server contains the library
|
|
20
|
+
**Smart table lookup with server detection**
|
|
24
21
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
22
|
+
Use `sas-score-find-table` with intelligent server detection:
|
|
23
|
+
|
|
24
|
+
1. **First attempt**: Check CAS server (`server: "cas"`)
|
|
25
|
+
- If table exists → return table and server to caller
|
|
26
|
+
- If table not found → proceed to step 2
|
|
27
|
+
|
|
28
|
+
2. **Second attempt**: Check SAS server (`server: "sas"`)
|
|
29
|
+
- If table exists → return table and server to caller
|
|
30
|
+
- If table not found in either server → inform user and suggest verifying the library and table names
|
|
31
|
+
|
|
32
|
+
**Possible outcomes:**
|
|
33
|
+
- Table found in CAS → use `server: "cas"` for subsequent read operations
|
|
34
|
+
- Table found in SAS → use `server: "sas"` for subsequent read operations
|
|
35
|
+
- Table not found in either server → inform user: *"The table 'lib.table' was not found in CAS or SAS. Please verify the library and table names."*
|
|
32
36
|
|
|
33
37
|
---
|
|
34
38
|
|
|
@@ -55,6 +59,13 @@ Ask yourself: does the user already have the data in hand?
|
|
|
55
59
|
|
|
56
60
|
**How:**
|
|
57
61
|
```
|
|
62
|
+
sas-score-find-table({
|
|
63
|
+
lib: "libraryname",
|
|
64
|
+
table: "tablename",
|
|
65
|
+
server: "cas" // start with CAS
|
|
66
|
+
})
|
|
67
|
+
// if not found, repeat with server: "sas"
|
|
68
|
+
|
|
58
69
|
sas-score-read-table({
|
|
59
70
|
table: "tablename",
|
|
60
71
|
lib: "libraryname",
|
|
@@ -65,11 +76,11 @@ sas-score-read-table({
|
|
|
65
76
|
```
|
|
66
77
|
|
|
67
78
|
**Rules:**
|
|
68
|
-
- Always determine the server first using `sas-score-find-table`
|
|
79
|
+
- Always determine the server first using `sas-score-find-table` with smart detection (CAS → SAS)
|
|
69
80
|
- Keep batch size ≤ 50 rows unless the user explicitly requests more
|
|
70
81
|
- If table name is missing, ask: *"Which table should I read from? (format: lib.tablename)"*
|
|
71
82
|
- If library is missing, ask: *"Which library contains the table?"*
|
|
72
|
-
- If table exists in both servers,
|
|
83
|
+
- If table exists in both servers, prefer CAS (already determined by smart detection)
|
|
73
84
|
- Return raw column values; do not transform or aggregate
|
|
74
85
|
|
|
75
86
|
---
|
|
@@ -83,6 +94,13 @@ sas-score-read-table({
|
|
|
83
94
|
|
|
84
95
|
**How:**
|
|
85
96
|
```
|
|
97
|
+
sas-score-find-table({
|
|
98
|
+
lib: "libraryname",
|
|
99
|
+
table: "tablename",
|
|
100
|
+
server: "cas" // start with CAS
|
|
101
|
+
})
|
|
102
|
+
// if not found, repeat with server: "sas"
|
|
103
|
+
|
|
86
104
|
sas-query({
|
|
87
105
|
table: "lib.tablename",
|
|
88
106
|
query: "user's natural language question",
|
|
@@ -91,8 +109,8 @@ sas-query({
|
|
|
91
109
|
```
|
|
92
110
|
|
|
93
111
|
**Rules:**
|
|
94
|
-
- Check which server
|
|
95
|
-
- If table exists in
|
|
112
|
+
- Check which server contains the table using `sas-score-find-table` with smart detection (CAS → SAS) first
|
|
113
|
+
- If table exists in CAS, query from CAS; if only in SAS, query from SAS
|
|
96
114
|
- Parse the user's natural language question into a PROC SQL SELECT statement
|
|
97
115
|
- Ensure SELECT statement is valid SQL syntax
|
|
98
116
|
- Do not add trailing semicolons to the SQL string
|
|
@@ -129,11 +147,12 @@ sas-query({
|
|
|
129
147
|
|
|
130
148
|
| Problem | Action |
|
|
131
149
|
|---|---|
|
|
132
|
-
|
|
|
133
|
-
| Table not found in either server | Inform user
|
|
134
|
-
| Table exists in
|
|
135
|
-
| Table exists only in
|
|
136
|
-
| Table name missing entirely | Ask: *"Which table should I read from?"* |
|
|
150
|
+
| Table not found in CAS | Try SAS server using `sas-score-find-table` with `server: "sas"` |
|
|
151
|
+
| Table not found in either server | Inform user: *"The table 'lib.table' was not found in CAS or SAS. Please verify the library and table names."* |
|
|
152
|
+
| Table exists only in CAS | Use `server: "cas"` automatically for read operations |
|
|
153
|
+
| Table exists only in SAS | Use `server: "sas"` automatically for read operations |
|
|
154
|
+
| Table name missing entirely | Ask: *"Which table should I read from? (format: lib.tablename)"* |
|
|
155
|
+
| Library name missing | Ask: *"Which library contains the table?"* |
|
|
137
156
|
| Ambiguous intent (raw vs aggregate) | Ask: *"Do you want individual rows or a summary by some field?"* |
|
|
138
157
|
| Empty result | Inform user, ask to adjust filter or query |
|
|
139
158
|
|
|
@@ -141,7 +160,7 @@ sas-query({
|
|
|
141
160
|
|
|
142
161
|
## Integration with other skills
|
|
143
162
|
|
|
144
|
-
- **Before this skill**: Use `sas-find-
|
|
163
|
+
- **Before this skill**: Use `sas-score-find-table` to verify the table exists and determine the server location
|
|
145
164
|
- **After this skill**: Use `sas-read-and-score` to score the retrieved data
|
|
146
165
|
|
|
147
166
|
---
|
package/src/toolSet/findTable.js
CHANGED
|
@@ -17,7 +17,7 @@ DO NOT USE for: list tables (use list-tables), table schema/columns (use table-i
|
|
|
17
17
|
PARAMETERS
|
|
18
18
|
- lib: string (required) — library name (e.g., 'Public', 'sashelp')
|
|
19
19
|
- name: string (required) — table name to locate
|
|
20
|
-
- server: 'cas' | 'sas'
|
|
20
|
+
- server: 'cas' | 'sas' . If not specified set it to 'cas' — target environment
|
|
21
21
|
|
|
22
22
|
ROUTING RULES
|
|
23
23
|
- "find table <name> in <lib>" → { lib: "<lib>", name: "<name>", server: "cas" }
|
|
@@ -49,7 +49,7 @@ Returns { tables: [] } if not found; { tables: [name, ...] } if found. Never hal
|
|
|
49
49
|
inputSchema: z.object({
|
|
50
50
|
name: z.string(),
|
|
51
51
|
lib: z.string(),
|
|
52
|
-
server: z.string()
|
|
52
|
+
server: z.string()
|
|
53
53
|
}),
|
|
54
54
|
|
|
55
55
|
handler: async (params) => {
|