@sassoftware/mcp-serverjs
Version:
A mcp server for SAS Viya
52 lines (41 loc) • 1.38 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 _listTables from '../toolhelpers/_listTables.js';
const log = debug('tools');
function findTable() {
let description = `
If server is not specified default to 'cas'.
If multiple names are specified, repeat the operation for
each of the names
- **name**: The name of the table to find
- **lib**: The name of the library where the table is located
- **server**: The server to search in, either 'cas' or 'sas'. Default is 'cas'.
- find table iris in Public library in cas server
- find table iris in sasuser library in sas server
`;
let spec = {
name: 'findTable',
description: description,
schema: {
server: z.string(), // default server is 'cas',
name: z.string(),
lib: z.string()
},
required: ['name', 'lib'],
handler: async (params) => {
// Check if the params.scenario is a string and parse it
let r = await _listTables(params);
return r;
}
}
return spec;
}
export default findTable;