@sassoftware/sas-score-mcp-serverjs 0.3.29-0 → 0.4.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.
- package/cli.js +118 -3
- package/openApi.yaml +121 -121
- package/package.json +4 -5
- package/skills/mcp-tool-description-optimizer/SKILL.md +129 -0
- package/skills/mcp-tool-description-optimizer/references/examples.md +123 -0
- package/skills/sas-read-and-score/SKILL.md +91 -0
- package/skills/sas-read-strategy/SKILL.md +143 -0
- package/skills/sas-score-workflow/SKILL.md +283 -0
- package/src/createMcpServer.js +11 -4
- package/src/expressMcpServer.js +1 -1
- package/src/handleGetDelete.js +1 -1
- package/src/openApi.yaml +121 -121
- package/src/toolHelpers/_jobSubmit.js +2 -0
- package/src/toolHelpers/_listLibrary.js +56 -39
- package/src/toolHelpers/readCerts.js +4 -4
- package/src/toolSet/devaScore.js +31 -44
- package/src/toolSet/findJob.js +37 -70
- package/src/toolSet/findJobdef.js +27 -58
- package/src/toolSet/findLibrary.js +29 -62
- package/src/toolSet/findModel.js +34 -57
- package/src/toolSet/findTable.js +29 -59
- package/src/toolSet/getEnv.js +26 -45
- package/src/toolSet/listJobdefs.js +30 -65
- package/src/toolSet/listJobs.js +30 -79
- package/src/toolSet/listLibraries.js +43 -55
- package/src/toolSet/listModels.js +25 -52
- package/src/toolSet/listTables.js +36 -66
- package/src/toolSet/makeTools.js +1 -0
- package/src/toolSet/modelInfo.js +21 -53
- package/src/toolSet/modelScore.js +30 -73
- package/src/toolSet/readTable.js +33 -72
- package/src/toolSet/runCasProgram.js +30 -51
- package/src/toolSet/runJob.js +24 -24
- package/src/toolSet/runJobdef.js +26 -29
- package/src/toolSet/runMacro.js +23 -24
- package/src/toolSet/runProgram.js +32 -80
- package/src/toolSet/sasQuery.js +31 -79
- package/src/toolSet/sasQueryTemplate.js +4 -5
- package/src/toolSet/sasQueryTemplate2.js +4 -5
- package/src/toolSet/scrInfo.js +4 -7
- package/src/toolSet/scrScore.js +2 -4
- package/src/toolSet/searchAssets.js +5 -6
- package/src/toolSet/setContext.js +30 -57
- package/src/toolSet/superstat.js +2 -3
- package/src/toolSet/tableInfo.js +32 -77
package/src/toolSet/tableInfo.js
CHANGED
|
@@ -9,89 +9,44 @@ import _tableInfo from '../toolHelpers/_tableInfo.js';
|
|
|
9
9
|
function tableInfo(_appContext) {
|
|
10
10
|
|
|
11
11
|
let describe = `
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
-
|
|
34
|
-
-
|
|
35
|
-
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
Returns
|
|
39
|
-
|
|
40
|
-
- name: Column name (string)
|
|
41
|
-
- type: Data type (string) - e.g., 'numeric', 'character'
|
|
42
|
-
- label: Column label if defined (string)
|
|
43
|
-
- format: Display format if defined (string)
|
|
44
|
-
- length: Column length for character fields (number)
|
|
45
|
-
- tableInfo: Table-level metadata including:
|
|
46
|
-
- rowCount: Number of rows (number)
|
|
47
|
-
- fileSize: File size if available (number)
|
|
48
|
-
- created: Creation timestamp if available (string)
|
|
49
|
-
- modified: Last modified timestamp if available (string)
|
|
50
|
-
- Empty object if table not found or accessible
|
|
51
|
-
|
|
52
|
-
Disambiguation & Clarification
|
|
53
|
-
- Missing library: ask "Which library contains the table you want to inspect?"
|
|
54
|
-
- Missing table: ask "Which table would you like information about?"
|
|
55
|
-
- If user wants data: clarify "Do you want the table structure (use table-info) or actual data rows (use read-table)?"
|
|
56
|
-
- Ambiguous lib.table format: parse and use as separate parameters
|
|
57
|
-
|
|
58
|
-
Examples (→ mapped params)
|
|
59
|
-
- "describe table cars in sashelp" → { table: "cars", lib: "sashelp", server: "sas" }
|
|
60
|
-
- "what columns are in orders from Public" → { table: "orders", lib: "Public", server: "cas" }
|
|
61
|
-
- "show schema for sales in mylib" → { table: "sales", lib: "mylib", server: "cas" }
|
|
62
|
-
- "table info for iris in Samples" → { table: "iris", lib: "Samples", server: "cas" }
|
|
63
|
-
- "how many rows in customers on cas" → { table: "customers", lib: <lib>, server: "cas" }
|
|
64
|
-
|
|
65
|
-
Negative Examples (should NOT call table-info)
|
|
66
|
-
- "read 10 rows from cars" (use read-table instead)
|
|
67
|
-
- "list tables in sashelp" (use list-tables instead)
|
|
68
|
-
- "does table cars exist in Public?" (use find-table instead)
|
|
69
|
-
- "run query on customers table" (use sas-query instead)
|
|
70
|
-
- "show me data from the sales table" (use read-table instead)
|
|
71
|
-
|
|
72
|
-
Usage Tips
|
|
73
|
-
- Use this tool to inspect schema and column types before scoring or reading data.
|
|
74
|
-
- After inspecting structure, use read-table to fetch actual data.
|
|
75
|
-
- Combine with find-table to verify existence before inspection.
|
|
76
|
-
|
|
77
|
-
Related Tools
|
|
78
|
-
- find-table → table-info → read-table (typical workflow)
|
|
79
|
-
- list-tables — to discover tables before inspecting
|
|
80
|
-
- read-table — to fetch actual data after inspecting structure
|
|
81
|
-
- find-table — to verify a table exists before inspection
|
|
82
|
-
`;
|
|
12
|
+
table-info — retrieve metadata about a table in a CAS or SAS library.
|
|
13
|
+
|
|
14
|
+
USE when: what columns, describe structure, show schema, table statistics, column info
|
|
15
|
+
DO NOT USE for: read data (use read-table), list tables (use list-tables), find table (use find-table), queries (use sas-query)
|
|
16
|
+
|
|
17
|
+
PARAMETERS
|
|
18
|
+
- table: string — table name (required)
|
|
19
|
+
- lib: string — caslib or libref (required)
|
|
20
|
+
- server: string (default: 'cas') — 'cas' or 'sas'
|
|
21
|
+
|
|
22
|
+
ROUTING RULES
|
|
23
|
+
- "what columns are in cars" → { table: "cars", lib: "<lib>", server: "cas" }
|
|
24
|
+
- "describe table sales in Public" → { table: "sales", lib: "Public", server: "cas" }
|
|
25
|
+
- "show schema for mylib.iris on sas" → { table: "iris", lib: "mylib", server: "sas" }
|
|
26
|
+
|
|
27
|
+
EXAMPLES
|
|
28
|
+
- "what columns in cars" → { table: "cars", lib: "<lib>", server: "cas" }
|
|
29
|
+
- "describe structure of customers in Public" → { table: "customers", lib: "Public", server: "cas" }
|
|
30
|
+
|
|
31
|
+
NEGATIVE EXAMPLES (do not route here)
|
|
32
|
+
- "read table cars" (use read-table)
|
|
33
|
+
- "list tables in Public" (use list-tables)
|
|
34
|
+
- "does table exist" (use find-table)
|
|
35
|
+
- "query table" (use sas-query)
|
|
36
|
+
|
|
37
|
+
ERRORS
|
|
38
|
+
Returns columns array (name, type, label, format, length) and tableInfo (rowCount, fileSize, created, modified).
|
|
39
|
+
`;
|
|
83
40
|
|
|
84
41
|
let specs = {
|
|
85
42
|
name: 'table-info',
|
|
86
|
-
aliases: ['tableInfo','table info','table_info'],
|
|
87
43
|
description: describe,
|
|
88
|
-
|
|
44
|
+
inputSchema: z.object({
|
|
89
45
|
table: z.string(),
|
|
90
46
|
lib: z.string(),
|
|
91
47
|
server: z.string()
|
|
92
|
-
},
|
|
93
|
-
|
|
94
|
-
handler: async (params) => {
|
|
48
|
+
}),
|
|
49
|
+
handler: async (params) => {
|
|
95
50
|
params.describe = true;
|
|
96
51
|
let r = await _tableInfo(params);
|
|
97
52
|
return r;
|
|
@@ -99,4 +54,4 @@ Related Tools
|
|
|
99
54
|
}
|
|
100
55
|
return specs;
|
|
101
56
|
}
|
|
102
|
-
export default tableInfo;
|
|
57
|
+
export default tableInfo;
|