Skip to main content
Glama
gabrielrojasnyc

HR MCP Server

get_employee_info

Retrieve detailed employee information, including optional sensitive data, by providing an employee ID. Supports HR operations for structured employee data lookups.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
employee_idYesThe ID of the employee to retrieve information for
include_sensitiveNoWhether to include sensitive information like SSN (default: false)

Implementation Reference

  • src/index.ts:25-134 (registration)
    Registration of the get_employee_info MCP tool with inline Zod schema and handler function that fetches and formats comprehensive employee profile information from the employeesData store.
    server.tool(
      "get_employee_info",
      { 
        employee_id: z.string().describe("The ID of the employee to retrieve information for"),
        include_sensitive: z.boolean().optional().default(false).describe("Whether to include sensitive information like SSN (default: false)")
      },
      async ({ employee_id, include_sensitive }) => {
        logMessage(`Looking up employee: ${employee_id}`);
        
        // Look up employee in our "database"
        const employee = employeesData[employee_id];
        if (!employee) {
          return {
            content: [{ type: "text", text: `No employee found with ID ${employee_id}.` }],
            isError: false
          };
        }
        
        // Format basic employee information
        let info = `# Employee Information for ${employee.name} (${employee_id})\n\n` +
          `## Personal Details\n` +
          `* **Name:** ${employee.name}\n` +
          `* **Title:** ${employee.title}\n` +
          `* **Department:** ${employee.department}\n` +
          `* **Email:** ${employee.email}\n` +
          `* **Phone:** ${employee.phoneNumber}\n` +
          `* **Date of Birth:** ${employee.dob}\n` +
          `* **Location:** ${employee.location.city}, ${employee.location.state}, ${employee.location.country}\n\n` +
          
          `## Employment Details\n` +
          `* **Hire Date:** ${employee.hireDate}\n` +
          `* **Years in Company:** ${employee.yearsInCompany}\n` +
          `* **Performance Rating:** ${employee.performanceRating}/5\n`;
        
        // Add manager information if exists
        if (employee.manager) {
          const manager = employeesData[employee.manager];
          info += `* **Manager:** ${manager ? manager.name : "Unknown"} (${employee.manager})\n`;
        } else {
          info += `* **Manager:** None (Executive Level)\n`;
        }
        
        // Add direct reports if any
        if (employee.directReports.length > 0) {
          info += `* **Direct Reports:** ${employee.directReports.length}\n`;
          info += `  * ${employee.directReports.map(id => {
            const report = employeesData[id];
            return report ? `${report.name} (${id})` : `Unknown (${id})`;
          }).join("\n  * ")}\n`;
        } else {
          info += `* **Direct Reports:** None\n`;
        }
        
        // Add more professional details
        info += `\n## Professional Details\n` +
          `* **Education:** ${employee.educationLevel}\n` +
          `* **Certifications:** ${employee.certifications.join(", ") || "None"}\n` +
          `* **Skills:** ${employee.skills.join(", ")}\n`;
        
        // Add project information
        info += `* **Current Projects:** ${employee.projectAssignments.join(", ") || "None"}\n\n`;
        
        // Add leave information
        info += `## Leave Information\n` +
          `* **Vacation Days:** ${employee.vacationDays.used} used / ${employee.vacationDays.total} total (${employee.vacationDays.remaining} remaining)\n` +
          `* **Sick Days:** ${employee.sickDays.used} used / ${employee.sickDays.total} total (${employee.sickDays.remaining} remaining)\n\n`;
        
        // Add previous positions if any
        if (employee.previousPositions.length > 0) {
          info += `## Previous Positions\n`;
          employee.previousPositions.forEach(position => {
            info += `* **${position.title}** (${position.department}): ${position.startDate} to ${position.endDate}\n`;
          });
          info += `\n`;
        }
        
        // Add emergency contact
        info += `## Emergency Contact\n` +
          `* **Name:** ${employee.emergencyContact.name}\n` +
          `* **Relationship:** ${employee.emergencyContact.relationship}\n` +
          `* **Phone:** ${employee.emergencyContact.phoneNumber}\n\n`;
        
        // Add benefits information
        info += `## Benefits\n` +
          `* **Health Insurance:** ${employee.benefits.healthInsurance ? "Enrolled" : "Not Enrolled"}\n` +
          `* **Dental Insurance:** ${employee.benefits.dentalInsurance ? "Enrolled" : "Not Enrolled"}\n` +
          `* **Vision Insurance:** ${employee.benefits.visionInsurance ? "Enrolled" : "Not Enrolled"}\n` +
          `* **401(k):** ${employee.benefits.retirement401k ? "Enrolled" : "Not Enrolled"}\n` +
          `* **Stock Options:** ${employee.benefits.stockOptions ? "Enrolled" : "Not Enrolled"}\n\n`;
        
        // Add notes
        info += `## Notes\n${employee.notes}\n\n`;
        
        // Add sensitive information only if requested
        if (include_sensitive) {
          info += `## Confidential Information (RESTRICTED ACCESS)\n` +
            `* **Salary:** $${employee.salary.toLocaleString()}/year\n` +
            `* **SSN:** ${employee.ssn}\n` +
            `* **Last Promotion Date:** ${employee.lastPromotionDate || "No promotions yet"}\n`;
        } else {
          info += `## Confidential Information\n` +
            `* Restricted - Use include_sensitive=true parameter to view\n`;
        }
        
        return {
          content: [{ type: "text", text: info }],
          isError: false
        };
      }
    );
  • Modular implementation of the get_employee_info tool handler. Retrieves employee data by ID from static data source, formats extensive markdown report with personal, employment, professional details, leave info, benefits, notes, and optionally sensitive data like salary and SSN.
    export const getEmployeeInfo = async (
      { employee_id, include_sensitive }: { employee_id: string, include_sensitive: boolean },
      extra: any 
    ) => {
      logMessage(`Looking up employee: ${employee_id}`);
      
      // Look up employee in our "database"
      const employee = employeesData[employee_id];
      if (!employee) {
        return {
          content: [{ type: "text", text: `No employee found with ID ${employee_id}.` }],
          isError: false
        };
      }
      
      // Format basic employee information
      let info = `# Employee Information for ${employee.name} (${employee_id})\n\n` +
        `## Personal Details\n` +
        `* **Name:** ${employee.name}\n` +
        `* **Title:** ${employee.title}\n` +
        `* **Department:** ${employee.department}\n` +
        `* **Email:** ${employee.email}\n` +
        `* **Phone:** ${employee.phoneNumber}\n` +
        `* **Date of Birth:** ${employee.dob}\n` +
        `* **Location:** ${employee.location.city}, ${employee.location.state}, ${employee.location.country}\n\n` +
        
        `## Employment Details\n` +
        `* **Hire Date:** ${employee.hireDate}\n` +
        `* **Years in Company:** ${employee.yearsInCompany}\n` +
        `* **Performance Rating:** ${employee.performanceRating}/5\n`;
      
      // Add manager information if exists
      if (employee.manager) {
        const manager = employeesData[employee.manager];
        info += `* **Manager:** ${manager ? manager.name : "Unknown"} (${employee.manager})\n`;
      } else {
        info += `* **Manager:** None (Executive Level)\n`;
      }
      
      // Add direct reports if any
      if (employee.directReports.length > 0) {
        info += `* **Direct Reports:** ${employee.directReports.length}\n`;
        info += `  * ${employee.directReports.map(id => {
          const report = employeesData[id];
          return report ? `${report.name} (${id})` : `Unknown (${id})`;
        }).join("\n  * ")}\n`;
      } else {
        info += `* **Direct Reports:** None\n`;
      }
      
      // Add more professional details
      info += `\n## Professional Details\n` +
        `* **Education:** ${employee.educationLevel}\n` +
        `* **Certifications:** ${employee.certifications.join(", ") || "None"}\n` +
        `* **Skills:** ${employee.skills.join(", ")}\n`;
      
      // Add project information
      info += `* **Current Projects:** ${employee.projectAssignments.join(", ") || "None"}\n\n`;
      
      // Add leave information
      info += `## Leave Information\n` +
        `* **Vacation Days:** ${employee.vacationDays.used} used / ${employee.vacationDays.total} total (${employee.vacationDays.remaining} remaining)\n` +
        `* **Sick Days:** ${employee.sickDays.used} used / ${employee.sickDays.total} total (${employee.sickDays.remaining} remaining)\n\n`;
      
      // Add previous positions if any
      if (employee.previousPositions.length > 0) {
        info += `## Previous Positions\n`;
        employee.previousPositions.forEach(position => {
          info += `* **${position.title}** (${position.department}): ${position.startDate} to ${position.endDate}\n`;
        });
        info += `\n`;
      }
      
      // Add emergency contact
      info += `## Emergency Contact\n` +
        `* **Name:** ${employee.emergencyContact.name}\n` +
        `* **Relationship:** ${employee.emergencyContact.relationship}\n` +
        `* **Phone:** ${employee.emergencyContact.phoneNumber}\n\n`;
      
      // Add benefits information
      info += `## Benefits\n` +
        `* **Health Insurance:** ${employee.benefits.healthInsurance ? "Enrolled" : "Not Enrolled"}\n` +
        `* **Dental Insurance:** ${employee.benefits.dentalInsurance ? "Enrolled" : "Not Enrolled"}\n` +
        `* **Vision Insurance:** ${employee.benefits.visionInsurance ? "Enrolled" : "Not Enrolled"}\n` +
        `* **401(k):** ${employee.benefits.retirement401k ? "Enrolled" : "Not Enrolled"}\n` +
        `* **Stock Options:** ${employee.benefits.stockOptions ? "Enrolled" : "Not Enrolled"}\n\n`;
      
      // Add notes
      info += `## Notes\n${employee.notes}\n\n`;
      
      // Add sensitive information only if requested
      if (include_sensitive) {
        info += `## Confidential Information (RESTRICTED ACCESS)\n` +
          `* **Salary:** $${employee.salary.toLocaleString()}/year\n` +
          `* **SSN:** ${employee.ssn}\n` +
          `* **Last Promotion Date:** ${employee.lastPromotionDate || "No promotions yet"}\n`;
      } else {
        info += `## Confidential Information\n` +
          `* Restricted - Use include_sensitive=true parameter to view\n`;
      }
      
      return {
        content: [{ type: "text", text: info }],
        isError: false
      };
    };
  • Zod-based input schema for the get_employee_info tool parameters: required employee_id (string) and optional include_sensitive (boolean, default false).
    export const getEmployeeInfoSchema = {
      employee_id: z.string().describe("The ID of the employee to retrieve information for"),
      include_sensitive: z.boolean().optional().default(false).describe("Whether to include sensitive information like SSN (default: false)")
    };
  • Inline Zod schema used in the registration of get_employee_info tool, matching the modular schema.
    { 
      employee_id: z.string().describe("The ID of the employee to retrieve information for"),
      include_sensitive: z.boolean().optional().default(false).describe("Whether to include sensitive information like SSN (default: false)")
    },
  • build/index.js:22-26 (registration)
    Built version registration in build/index.js.
    server.tool("get_employee_info", {
        employee_id: z.string().describe("The ID of the employee to retrieve information for"),
        include_sensitive: z.boolean().optional().default(false).describe("Whether to include sensitive information like SSN (default: false)")
    }, async ({ employee_id, include_sensitive }) => {
        logMessage(`Looking up employee: ${employee_id}`);
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Tool has no description.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness1/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Tool has no description.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Tool has no description.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Tool has no description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose1/5

Does the description clearly state what the tool does and how it differs from similar tools?

Tool has no description.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Tool has no description.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

Latest Blog Posts

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/gabrielrojasnyc/hr-mcp-server'

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