@sassoftware/mcp-serverjs
Version:
A mcp server for SAS Viya
47 lines (40 loc) • 1.28 kB
JavaScript
/*
* Copyright © 2025, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
import { z } from 'zod';
import debug from 'debug';
import _tableInfo from '../toolhelpers/_tableInfo.js';
function tableInfo(Table) {
const log = debug('tools');
let describe = `
Use readTable to read the table and get the data.
- table - the name of the table to get information about.
- lib - the caslib or libref the table is in.
- table - the name of the table to read
- lib - the caslib or libref the table is in.
- server - the server to read the table from. The value can be either 'cas' or 'sas'. Default is cas.
- tableInfo for cars in lib Public
`;
let specs = {
name: 'tableInfo',
description: describe,
schema: {
table: z.string(),
lib: z.string(),
server: z.string()
},
required: ['table', 'lib'],
handler: async (params) => {
let r = await _tableInfo(params, 'describe');
return r;
}
}
return specs;
}
export default tableInfo;