Skip to main content
Glama

MCP Resume Chat Server

by TharakaJayz
resumeParser.ts5.46 kB
import fs from "fs/promises"; import path from "path"; import { ResumeData } from "../types"; export class ResumeParser { private resumeData: ResumeData | null = null; constructor(private dataPath: string = "./data/resume.json") {} /** * Load resume data from JSON file */ async loadResumeData(): Promise<ResumeData> { try { const fullPath = path.resolve(this.dataPath); const data = await fs.readFile(fullPath, "utf-8"); this.resumeData = JSON.parse(data); return this.resumeData!; } catch (error) { throw new Error(`Failed to load resume data: ${error}`); } } /** * Get current resume data */ getResumeData(): ResumeData | null { return this.resumeData; } /** * Search for specific information in the resume */ searchResume(query: string): string[] { if (!this.resumeData) { throw new Error("Resume data not loaded"); } const results: string[] = []; const searchTerm = query.toLowerCase(); // Search in personal info if (this.resumeData.personalInfo.name.toLowerCase().includes(searchTerm)) { results.push(`Name: ${this.resumeData.personalInfo.name}`); } // Search in experience this.resumeData.experience.forEach((exp, index) => { if ( exp.company.toLowerCase().includes(searchTerm) || exp.position.toLowerCase().includes(searchTerm) || exp.description.toLowerCase().includes(searchTerm) ) { results.push( `Experience ${index + 1}: ${exp.position} at ${exp.company}` ); } }); // Search in skills const matchingSkills = this.resumeData.skills.filter((skill) => skill.toLowerCase().includes(searchTerm) ); if (matchingSkills.length > 0) { results.push(`Skills: ${matchingSkills.join(", ")}`); } // Search in education this.resumeData.education.forEach((edu, index) => { if ( edu.institution.toLowerCase().includes(searchTerm) || edu.degree.toLowerCase().includes(searchTerm) || edu.field.toLowerCase().includes(searchTerm) ) { results.push( `Education ${index + 1}: ${edu.degree} in ${edu.field} from ${ edu.institution }` ); } }); return results; } /** * Get formatted resume summary */ getResumeSummary(): string { if (!this.resumeData) { throw new Error("Resume data not loaded"); } const { personalInfo, summary, experience, education, skills } = this.resumeData; return ` Name: ${personalInfo.name} Email: ${personalInfo.email} Location: ${personalInfo.location || "Not specified"} Summary: ${summary} Current Position: ${ experience.find((exp) => exp.current)?.position || "Not specified" } Company: ${experience.find((exp) => exp.current)?.company || "Not specified"} Total Experience: ${experience.length} positions Education: ${education.map((edu) => `${edu.degree} in ${edu.field}`).join(", ")} Skills: ${skills.slice(0, 10).join(", ")}${skills.length > 10 ? "..." : ""} `.trim(); } /** * Get detailed work experience */ getWorkExperience(): string { if (!this.resumeData) { throw new Error("Resume data not loaded"); } return this.resumeData.experience .map( (exp, index) => ` ${index + 1}. ${exp.position} at ${exp.company} Duration: ${exp.startDate} - ${exp.endDate || "Present"} Description: ${exp.description} Key Achievements: ${exp.achievements.map((achievement) => ` • ${achievement}`).join("\n")} Technologies: ${exp.technologies.join(", ")} ` ) .join("\n"); } /** * Get education details */ getEducation(): string { if (!this.resumeData) { throw new Error("Resume data not loaded"); } return this.resumeData.education .map( (edu, index) => ` ${index + 1}. ${edu.degree} in ${edu.field} Institution: ${edu.institution} Duration: ${edu.startDate} - ${edu.endDate || "Present"} GPA: ${edu.gpa || "Not specified"} ${edu.achievements ? `Achievements: ${edu.achievements.join(", ")}` : ""} ` ) .join("\n"); } /** * Get skills list */ getSkills(): string { if (!this.resumeData) { throw new Error("Resume data not loaded"); } return this.resumeData.skills.join(", "); } /** * Get projects information */ getProjects(): string { if (!this.resumeData || !this.resumeData.projects) { return "No projects information available"; } return this.resumeData.projects .map( (project, index) => ` ${index + 1}. ${project.name} Description: ${project.description} Technologies: ${project.technologies.join(", ")} Duration: ${project.startDate} - ${project.endDate || "Present"} ${project.url ? `URL: ${project.url}` : ""} ${project.github ? `GitHub: ${project.github}` : ""} ` ) .join("\n"); } /** * Get certifications */ getCertifications(): string { if (!this.resumeData || !this.resumeData.certifications) { return "No certifications available"; } return this.resumeData.certifications .map( (cert, index) => ` ${index + 1}. ${cert.name} Issuer: ${cert.issuer} Date: ${cert.date} ${cert.credentialId ? `Credential ID: ${cert.credentialId}` : ""} ${cert.url ? `URL: ${cert.url}` : ""} ` ) .join("\n"); } }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/TharakaJayz/mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server