@sassoftware/mcp-serverjs
Version:
Demo of mcp server written in nodejs
42 lines (35 loc) • 1.08 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 _modelList from '../toolhelpers/_modelList.js';
const log = debug('tools');
function listModels() {
let description = `
The prompt must of the form
- list models.
It can be optionally followed by a limit parameter.
The limit parameter is the number of models that are returned. The default is 10.
- limit = the number of models to return. Default is 10.
- list models and limit to 20
`;
let spec = {
name: 'listModels',
description: description,
schema: {
'limit': z.number()
},
handler: async (params) => {
// Check if the params.scenario is a string and parse it
let r = await _modelList(params);
return r;
}
}
return spec;
}
export default listModels;