@sassoftware/sas-score-mcp-serverjs 0.4.1-18 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sassoftware/sas-score-mcp-serverjs",
3
- "version": "0.4.1-18",
3
+ "version": "0.4.1-19",
4
4
  "description": "A mcp server for SAS Viya",
5
5
  "author": "Deva Kumar <deva.kumar@sas.com>",
6
6
  "license": "Apache-2.0",
@@ -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, verify the library and determine which server(s) contain the table:
18
+ Before retrieving data, locate the table and determine which server contains it:
19
19
 
20
- **Step 1: Verify library existence**
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
- **Step 2: Locate the specific table**
26
- - Use `sas-score-find-table` to check if the table exists in the library
27
- - Possible outcomes:
28
- - If table exists **only in CAS** set `server: "cas"`
29
- - If table exists **only in SAS** set `server: "sas"`
30
- - If table exists **in both** → ask the user: *"The table exists in both CAS and SAS. Which server would you prefer to query from?"*
31
- - If table exists **in neither** inform user and suggest verifying the table name
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, ask user which to use
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(s) contain the table using `sas-score-find-table` first
95
- - If table exists in both CAS and SAS, ask user which to query from
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
- | Library not found | Use `sas-find-library-smart` skill to verify the library exists |
133
- | Table not found in either server | Inform user and suggest checking the table name |
134
- | Table exists in both CAS and SAS | Ask: *"The table exists in both servers. Which would you prefer: CAS or SAS?"* |
135
- | Table exists only in one server | Use that server automatically in your request |
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-library-smart` to verify and locate the library
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
  ---
@@ -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' (default: 'cas') — target environment
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().optional() // default server is 'cas'
52
+ server: z.string()
53
53
  }),
54
54
 
55
55
  handler: async (params) => {