efect-inspection-tools-mcp-server
Version:
Defect inspection tools server handling defect detection, analysis, and reporting with AI/ML capabilities for quality control
20 lines • 797 B
JavaScript
import { getMongoClient, getConfig } from "syia-mcp-utils";
import { ObjectId } from "mongodb";
export class GeneralHandler {
constructor() { }
async getUserDetails(identifier) {
try {
const mongoClient = await getMongoClient(getConfig().mongoUri);
const db = mongoClient.db();
const collection = db.collection("users");
const query = { _id: new ObjectId(identifier) };
const projection = { _id: 0, firstName: 1, lastName: 1, email: 1, phone: 1 };
const result = await collection.findOne(query, { projection });
return result || { error: "User not found" };
}
catch (error) {
return { error: String(error) };
}
}
}
//# sourceMappingURL=generalHandler.js.map