modus_get_current_headcount
Retrieve current headcount for specific departments, roles, or employment status. Use filters to get exact employee counts by team or position.
Instructions
Get current headcount by team, role, or department with filtering. Returns employee data including roles, departments, and employment status.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| department | No | Filter by department name (e.g., 'Sales', 'Engineering') | |
| role | No | Filter by job role (e.g., 'Account Executive', 'SDR') | |
| status | No | Filter by employment status | ACTIVE |
Implementation Reference
- modus-mcp-server.js:55-77 (schema)Schema definition for modus_get_current_headcount tool, with input properties: department (string), role (string), status (enum: ACTIVE/INACTIVE, default ACTIVE).
name: "modus_get_current_headcount", description: "Get current headcount by team, role, or department with filtering. Returns employee data including roles, departments, and employment status.", inputSchema: { type: "object", properties: { department: { type: "string", description: "Filter by department name (e.g., 'Sales', 'Engineering')", }, role: { type: "string", description: "Filter by job role (e.g., 'Account Executive', 'SDR')", }, status: { type: "string", enum: ["ACTIVE", "INACTIVE"], default: "ACTIVE", description: "Filter by employment status", }, }, }, }, - modus-mcp-server.js:53-77 (registration)Tool is registered in the TOOLS array along with other tools, which is returned via ListToolsRequestSchema handler.
const TOOLS = [ { name: "modus_get_current_headcount", description: "Get current headcount by team, role, or department with filtering. Returns employee data including roles, departments, and employment status.", inputSchema: { type: "object", properties: { department: { type: "string", description: "Filter by department name (e.g., 'Sales', 'Engineering')", }, role: { type: "string", description: "Filter by job role (e.g., 'Account Executive', 'SDR')", }, status: { type: "string", enum: ["ACTIVE", "INACTIVE"], default: "ACTIVE", description: "Filter by employment status", }, }, }, }, - modus-mcp-server.js:402-460 (handler)Handler for modus_get_current_headcount. Calls /api/employees, filters by department/role/status client-side, computes summary statistics (total, byDepartment, byRole), and returns JSON response with up to 100 employees.
case "modus_get_current_headcount": { const { department, role, status = "ACTIVE" } = args || {}; const params = new URLSearchParams(); // Note: employees API uses filter-based querying, not simple params // For now, fetch all and filter client-side // TODO: Update to use proper filter syntax when documented response = await modusApi.get(`/api/employees`); // Extract employees from response const data = response.data || {}; let employees = data.employees || []; // Client-side filtering if (department) { employees = employees.filter(emp => emp.department?.toLowerCase().includes(department.toLowerCase())); } if (role) { employees = employees.filter(emp => emp.jobRole?.toLowerCase().includes(role.toLowerCase())); } if (status) { employees = employees.filter(emp => emp.employmentStatus === status); } // Add summary statistics const summary = { total: employees.length, totalInAccount: data.totalCount || 0, byDepartment: {}, byRole: {}, }; employees.forEach((emp) => { if (emp.department) { summary.byDepartment[emp.department] = (summary.byDepartment[emp.department] || 0) + 1; } if (emp.jobRole) { summary.byRole[emp.jobRole] = (summary.byRole[emp.jobRole] || 0) + 1; } }); return { content: [ { type: "text", text: JSON.stringify( { summary, employees: employees.slice(0, 100), // Limit to first 100 for readability note: employees.length > 100 ? `Showing first 100 of ${employees.length} employees` : null, }, null, 2 ), }, ], }; }