Skip to main content
Glama
wspotter

MCP Art Supply Store

by wspotter

calculate_labor_cost

Calculate labor costs for a specific period using employee hours and rates to manage payroll expenses and budget planning.

Instructions

Calculate labor costs for a specific period based on employee hours and rates.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
endDateYesEnd date in YYYY-MM-DD format
startDateYesStart date in YYYY-MM-DD format

Implementation Reference

  • Input schema definition for the calculate_labor_cost tool, specifying required startDate and endDate parameters.
    {
      name: 'calculate_labor_cost',
      description: 'Calculate labor costs for a specific period based on employee hours and rates.',
      inputSchema: {
        type: 'object',
        properties: {
          startDate: { type: 'string', description: 'Start date in YYYY-MM-DD format' },
          endDate: { type: 'string', description: 'End date in YYYY-MM-DD format' },
        },
        required: ['startDate', 'endDate'],
      },
    },
  • The handler function that implements calculate_labor_cost logic. It computes the number of days between startDate and endDate, then calculates total labor cost by summing estimated weekly costs prorated over the period for each employee using their hourlyRate assuming 40 hours/week.
    case 'calculate_labor_cost': {
      const startDate = String(args?.startDate || '');
      const endDate = String(args?.endDate || '');
      
      const days = Math.ceil((new Date(endDate).getTime() - new Date(startDate).getTime()) / (1000 * 60 * 60 * 24));
      const totalCost = storeData.employees.reduce((sum, emp) => sum + (emp.hourlyRate * 40 * days / 7), 0);
      
      return {
        content: [{
          type: 'text',
          text: `šŸ’° Labor Cost Analysis\nšŸ“… Period: ${startDate} to ${endDate} (${days} days)\n\n${storeData.employees.map(emp =>
            `${emp.name}: $${(emp.hourlyRate * 40 * days / 7).toFixed(2)}`
          ).join('\n')}\n\nšŸ’µ Total Labor Cost: $${totalCost.toFixed(2)}\nšŸ“Š Daily Average: $${(totalCost / days).toFixed(2)}`
        }]
      };
    }
  • Mock employee data used in the labor cost calculation, providing names and hourly rates for cost computation.
    employees: [
      { id: 'EMP001', name: 'Alex Johnson', role: 'Store Manager', shift: 'Mon-Fri 9AM-6PM', hourlyRate: 22 },
      { id: 'EMP002', name: 'Maria Santos', role: 'Sales Associate', shift: 'Tue-Sat 10AM-7PM', hourlyRate: 16 },
      { id: 'EMP003', name: 'David Kim', role: 'Art Specialist', shift: 'Wed-Sun 11AM-8PM', hourlyRate: 18 },
    ]
  • src/index.ts:516-518 (registration)
    Registration of all tools including calculate_labor_cost via the ListToolsRequestSchema handler, which returns the complete tools array.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return { tools };
    });
Behavior2/5

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

With no annotations provided, the description carries full burden but only states what the tool does, not how it behaves. It doesn't disclose whether this is a read-only calculation, if it requires specific permissions, how it handles missing data, or what format the output takes. For a calculation tool with zero annotation coverage, this leaves significant behavioral gaps.

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

Conciseness5/5

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

The description is a single, efficient sentence that front-loads the core purpose without unnecessary words. Every element ('calculate labor costs', 'specific period', 'employee hours and rates') contributes directly to understanding the tool's function.

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

Completeness2/5

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

For a calculation tool with no annotations and no output schema, the description is insufficient. It doesn't explain what the calculation returns (e.g., total cost, breakdown by employee), how it sources employee data, or error conditions. The context signals indicate this tool needs more behavioral disclosure than provided.

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

Parameters3/5

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

The description mentions 'specific period' which aligns with the startDate and endDate parameters in the schema. With 100% schema description coverage providing format details (YYYY-MM-DD), the description adds minimal value beyond what the schema already documents, meeting the baseline for high coverage.

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

Purpose4/5

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

The description clearly states the verb 'calculate' and the resource 'labor costs', specifying it's based on employee hours and rates for a specific period. It distinguishes from siblings like 'calculate_discount' or 'calculate_profit_margin' by focusing on labor, but doesn't explicitly differentiate from other financial tools beyond naming.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives like 'get_daily_sales' or 'calculate_profit_margin'. It mentions 'specific period' but doesn't specify prerequisites, exclusions, or comparative contexts with sibling tools.

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

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/wspotter/mcpart'

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