# Lamha MCP

> Lamha. This MCP handles end-to-end logistics operations for e-commerce fulfillment. You can programmatically manage order creation, track inventory levels across warehouses, check delivery coverage by city, and interact with multiple carriers using your AI client.

## Overview
- **Category:** productivity
- **Price:** Free
- **Tags:** attendance-tracking, leave-management, payroll-management, employee-records, hr-automation, organizational-structure

## Description

This connector lets you manage the entire lifecycle of an e-commerce shipment directly from your agent. Need to know if a customer's zip code is deliverable? You can call tools that verify city coverage before anything else starts. Setting up a new sale means creating an order, which requires checking current inventory levels first. If things change, you can list all existing orders or fetch specific details for any single shipment. It keeps the data flow tight—you’re dealing with warehouse locations, carrier availability, and real-time product stock numbers. This capability is housed within the Vinkius catalog, giving your AI client access to a full suite of operational tools.

## Tools

### cancel_order
Marks an existing fulfillment order as cancelled and updates the status across systems.

### check_city_coverage
Determines if a given geographical location is within the service area for delivery.

### create_order
Initializes and saves a new, pending order record with product details and destination data.

### get_order
Retrieves all detailed information for one specific order ID or shipment tracking number.

### list_carriers
Provides a current list of third-party shipping companies that can be used for delivery.

### list_inventory
Shows all stocked products and their remaining quantities across the network.

### list_orders
Generates a list of multiple orders, useful for bulk reporting or auditing purposes.

### list_warehouses
Provides the names and locations of all operational fulfillment centers.

## Prompt Examples

**Prompt:** 
```
Show all departments and today's attendance.
```

**Response:** 
```
Departments: 6. Engineering (18), Sales (12), Marketing (8), HR (4), Finance (5), Operations (8). Total: 55 employees. Today's attendance: 48 present (87%), 4 on leave, 3 absent. Late arrivals: 2 (Ahmed, 9:15 AM; Fatima, 9:30 AM). Engineering: 16/18 present. Sales: 11/12. Full attendance: HR, Finance.
```

**Prompt:** 
```
Show pending leave requests and employee leave balances.
```

**Response:** 
```
Pending leave requests: 5. 1) Ahmed — Annual leave, May 1-5 (5 days), balance: 18 days. 2) Sarah — Sick leave, Apr 28 (1 day). 3) Omar — Annual, May 10-14 (5 days), balance: 12. 4) Fatima — Personal, Apr 30 (1 day). 5) Khalid — Annual, Jun 1-15 (15 days), balance: 20. Company avg leave balance: 14.2 days.
```

**Prompt:** 
```
Show payroll summary and employee details for the Engineering team.
```

**Response:** 
```
Engineering team: 18 employees. Manager: Sarah Ahmed. Payroll summary: Total: SAR 285K/mo. Average: SAR 15.8K. Range: SAR 8K-35K. New hires (90 days): 2. Attendance rate: 94%. Leave utilization: 62%. Top: Ali Hassan (Senior Dev, 5 yrs), Maryam Khalil (Lead, 4 yrs).
```

## Capabilities

### Verify delivery eligibility
Check if any specified city or postal code falls within available delivery zones.

### Generate new fulfillment orders
Create a structured, actionable order record using product and destination details.

### Retrieve specific shipment data
Pull all necessary details for one particular order ID or shipment number.

### List available shipping partners
Get a current roster of carriers that can handle the delivery.

### View stock levels by product
Retrieve a full list of products and their corresponding inventory counts across locations.

### Manage order records
List all orders, or fetch data for specific warehouse facilities.

## Use Cases

### Processing a large bulk order
An operations manager needs to process 50 new orders. Instead of manually creating each one, the agent first calls `list_inventory` to ensure stock levels are adequate, then uses `create_order` repeatedly for all 50 items.

### Investigating a late shipment
A customer calls about an overdue package. The agent immediately calls `get_order` using the tracking number to retrieve the last known status and identify which carrier is handling it, all without leaving the chat interface.

### Setting up a new service area
A sales team expands into a new region. They use `check_city_coverage` with several potential ZIP codes to verify that the Lamha network can actually deliver there before committing resources.

### Auditing inventory and shipments
An analyst needs to know what's in stock and where it is. The agent runs `list_warehouses` followed by `list_inventory` to build a single, comprehensive report on available product counts.

## Benefits

- Avoid manual data entry. Instead of copy-pasting order details into a shipping platform, your agent calls `create_order` directly, saving time and reducing input errors.
- Get real-time stock checks. Before processing an order, you can use `list_inventory` to confirm available items, preventing overselling or fulfillment delays.
- Route shipments efficiently. You can check delivery zones using `check_city_coverage` instantly, stopping the process if a location isn't serviced by any carrier.
- Handle changes quickly. If an order needs cancelling, calling `cancel_order` updates the status everywhere, which is faster than manually emailing customer service.
- Compare shipping options easily. You can run `list_carriers` to see all available partners and then use their details when requesting shipment data with `get_order`.

## How It Works

The bottom line is you get predictable, structured data outputs for logistics decisions without writing any backend code.

1. Tell your agent what you need to do—for example, 'Check if we can ship this item to ZIP 90210.'
2. The MCP executes the relevant function (like `check_city_coverage`) and returns a Boolean status or list of carriers.
3. Your agent uses that data point to proceed with the next action, like calling `create_order` if coverage is confirmed.

## Frequently Asked Questions

**Can I track employee attendance and leave?**
Yes. Monitor check-in/out records, view attendance summaries, and track leave balances, requests, and approvals for any employee.

**How does Lamha authentication work?**
Lamha uses a **Token** header (not Bearer) for authentication against `app.lamha.sa/api/v2`. This is a custom token format.

**Can I browse the organizational structure?**
Yes. Navigate departments, teams, and reporting hierarchies within the organization.

**How do I use `view_payroll_data` to access compensation information?**
The MCP pulls comprehensive payroll summaries. You can view total monthly salaries, average pay across teams, and even identify salary ranges for specific departments.

**What details does the `get_profile` tool provide for an employee's record?**
You get a full snapshot of the employee. This includes their current job title, department assignment, employment start date, and detailed status tracking within the company.

**Can I use this MCP to process multiple leave requests or employees at once?**
Yes, you can handle batch operations easily. You can list and review several pending leave requests simultaneously, or track the current status of many employee IDs in a single query.

**If I run `list_employees` with incorrect criteria, how does the system respond?**
The tool returns an explicit error message. It specifies exactly which criterion was invalid or missing (like a department ID or date range) and guides you on correcting the input.

**Does `track_leave_requests` show my historical leave usage?**
It tracks both current requests and historical balances. The system shows when leave was approved, how many days were taken, and your remaining balance against annual entitlements.