We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/uberr2000/mcp_demo'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
BaseTool.js•760 B
export class BaseTool {
constructor() {
if (this.constructor === BaseTool) {
throw new Error(
"BaseTool is an abstract class and cannot be instantiated directly"
);
}
}
get name() {
throw new Error("name() must be implemented");
}
get description() {
throw new Error("description() must be implemented");
}
get inputSchema() {
throw new Error("inputSchema() must be implemented");
}
async execute(params) {
throw new Error("execute() must be implemented");
}
validateInput(input) {
const schema = this.inputSchema;
// 这里可以使用 Joi 或其他验证库进行输入验证
return true;
}
}