@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.
Files changed (45) hide show
  1. package/cli.js +118 -3
  2. package/openApi.yaml +121 -121
  3. package/package.json +4 -5
  4. package/skills/mcp-tool-description-optimizer/SKILL.md +129 -0
  5. package/skills/mcp-tool-description-optimizer/references/examples.md +123 -0
  6. package/skills/sas-read-and-score/SKILL.md +91 -0
  7. package/skills/sas-read-strategy/SKILL.md +143 -0
  8. package/skills/sas-score-workflow/SKILL.md +283 -0
  9. package/src/createMcpServer.js +11 -4
  10. package/src/expressMcpServer.js +1 -1
  11. package/src/handleGetDelete.js +1 -1
  12. package/src/openApi.yaml +121 -121
  13. package/src/toolHelpers/_jobSubmit.js +2 -0
  14. package/src/toolHelpers/_listLibrary.js +56 -39
  15. package/src/toolHelpers/readCerts.js +4 -4
  16. package/src/toolSet/devaScore.js +31 -44
  17. package/src/toolSet/findJob.js +37 -70
  18. package/src/toolSet/findJobdef.js +27 -58
  19. package/src/toolSet/findLibrary.js +29 -62
  20. package/src/toolSet/findModel.js +34 -57
  21. package/src/toolSet/findTable.js +29 -59
  22. package/src/toolSet/getEnv.js +26 -45
  23. package/src/toolSet/listJobdefs.js +30 -65
  24. package/src/toolSet/listJobs.js +30 -79
  25. package/src/toolSet/listLibraries.js +43 -55
  26. package/src/toolSet/listModels.js +25 -52
  27. package/src/toolSet/listTables.js +36 -66
  28. package/src/toolSet/makeTools.js +1 -0
  29. package/src/toolSet/modelInfo.js +21 -53
  30. package/src/toolSet/modelScore.js +30 -73
  31. package/src/toolSet/readTable.js +33 -72
  32. package/src/toolSet/runCasProgram.js +30 -51
  33. package/src/toolSet/runJob.js +24 -24
  34. package/src/toolSet/runJobdef.js +26 -29
  35. package/src/toolSet/runMacro.js +23 -24
  36. package/src/toolSet/runProgram.js +32 -80
  37. package/src/toolSet/sasQuery.js +31 -79
  38. package/src/toolSet/sasQueryTemplate.js +4 -5
  39. package/src/toolSet/sasQueryTemplate2.js +4 -5
  40. package/src/toolSet/scrInfo.js +4 -7
  41. package/src/toolSet/scrScore.js +2 -4
  42. package/src/toolSet/searchAssets.js +5 -6
  43. package/src/toolSet/setContext.js +30 -57
  44. package/src/toolSet/superstat.js +2 -3
  45. package/src/toolSet/tableInfo.js +32 -77
@@ -9,89 +9,44 @@ import _tableInfo from '../toolHelpers/_tableInfo.js';
9
9
  function tableInfo(_appContext) {
10
10
 
11
11
  let describe = `
12
- ## table-info — retrieve metadata about a table in a CAS or SAS library
13
-
14
- LLM Invocation Guidance (When to use)
15
- Use THIS tool when:
16
- - User wants table structure/schema: "what columns are in the cars table?"
17
- - User wants column metadata: "describe the structure of customers table"
18
- - User wants to see data types: "show me the schema for sales table in Public"
19
- - User wants table statistics: "how many rows in the orders table?"
20
- - User wants column information: "what are the columns in the iris table?"
21
-
22
- Do NOT use this tool for:
23
- - Reading actual data rows (use read-table)
24
- - Listing tables in a library (use list-tables)
25
- - Checking if a table exists (use find-table)
26
- - Running queries (use sas-query)
27
- - Reading sample data (use read-table)
28
-
29
- Purpose
30
- Return metadata about a table in a specified library (caslib or libref). This includes column names, data types, labels, formats, and table-level statistics such as row count, file size, and timestamps.
31
-
32
- Parameters
33
- - table (string, required): The name of the table to inspect.
34
- - lib (string, required): The caslib or libref containing the table.
35
- - server (string, default 'cas'): Target server, either 'cas' or 'sas'. Defaults to 'cas' when omitted.
36
-
37
- Response Contract
38
- Returns a JSON object containing:
39
- - columns: Array of column objects with:
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
- schema: {
44
+ inputSchema: z.object({
89
45
  table: z.string(),
90
46
  lib: z.string(),
91
47
  server: z.string()
92
- },
93
- required: ['table', 'lib'],
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;