# ๐ง API Reference
Complete documentation for all MCP tools available in the Stevia Store server.
## Table of Contents
- [Product Management](#-product-management)
- [Customer Management](#-customer-management)
- [Order Processing](#-order-processing)
- [Inventory Control](#-inventory-control)
- [Analytics & Reporting](#-analytics--reporting)
- [Error Handling](#-error-handling)
- [Response Formats](#-response-formats)
---
## ๐๏ธ Product Management
### `add_product`
Add a new product to the catalog.
**Parameters:**
- `name` (string, required) - Product name
- `category` (string, required) - Product category
- `price` (float, required) - Selling price in โช
- `cost` (float, required) - Cost price in โช
- `description` (string, optional) - Product description
- `sku` (string, optional) - Stock Keeping Unit identifier
**Example:**
```json
{
"name": "ืกืืืืื ืืืจืื ืืช ืืืืืืช",
"category": "ืืืจื ืืื",
"price": 42.90,
"cost": 25.00,
"description": "ืกืืืืื ืืืืืชืืช ืืืืืื",
"sku": "STEV-SPEC-001"
}
```
**Response:**
```
โ
ืืืืฆืจ 'ืกืืืืื ืืืจืื ืืช ืืืืืืช' ื ืืกืฃ ืืืฆืืื ืขื ID: 6
```
---
### `get_products`
Retrieve product catalog with optional filtering.
**Parameters:**
- `category` (string, optional) - Filter by category
**Example:**
```json
{
"category": "ืืืจื ืืื"
}
```
**Response:**
```
๐๏ธ **ืจืฉืืืช ืืืืฆืจืื:**
**ืืืจื ืืื:**
โข **ืกืืืืื ืืืขืืช ืืืจืื ืืช** (#1)
ืืง"ื: STEV-ORG-100 | ืืืืจ: โช45.90 | ืจืืื: 45.5%
ืืืื: 150 ืืืืืืช โ
ืืืืื
ืชืืืืจ: ืกืืืืื ืืืขืืช 100% ืืืจืื ืืช ืืื ืชืืกืคืืช ืืืืืืช
```
---
## ๐ฅ Customer Management
### `add_customer`
Register a new customer.
**Parameters:**
- `name` (string, required) - Customer full name
- `email` (string, required) - Email address
- `phone` (string, optional) - Phone number
- `address` (string, optional) - Street address
- `city` (string, optional) - City name
**Example:**
```json
{
"name": "ืืืจืื ืืื",
"email": "avraham@example.com",
"phone": "050-1234567",
"address": "ืจืืื ืืจืฆื 15",
"city": "ืชื ืืืื"
}
```
**Response:**
```
โ
ืืืงืื 'ืืืจืื ืืื' ื ืืกืฃ ืืืฆืืื ืขื ID: 3
```
---
## ๐ Order Processing
### `create_order`
Create a new order for a customer.
**Parameters:**
- `customer_id` (integer, required) - Customer ID
- `products` (string, required) - JSON array of products
- `shipping_address` (string, optional) - Delivery address
- `notes` (string, optional) - Order notes
**Products Format:**
```json
[
{"product_id": 1, "quantity": 2},
{"product_id": 3, "quantity": 1}
]
```
**Example:**
```json
{
"customer_id": 1,
"products": "[{\"product_id\": 1, \"quantity\": 2}, {\"product_id\": 2, \"quantity\": 1}]",
"shipping_address": "ืจืืื ืื ืืืจืืื 10, ืืืคื",
"notes": "ืืฉืืื ืืืืจ"
}
```
**Response:**
```
โ
**ืืืื ื #5 ื ืืฆืจื ืืืฆืืื!**
๐ค ืืงืื: ืืืกื ืืื
๐ฐ ืกื"ื: โช121.70
๐ฆ **ืคืจืืืื ืืืืื ื:**
โข ืกืืืืื ืืืขืืช ืืืจืื ืืช x2 - โช91.80
โข ืกืืืืื ืืืืืืืช x1 - โช29.90
๐ ืืชืืืช ืืฉืืื: ืจืืื ืื ืืืจืืื 10, ืืืคื
```
---
## ๐ฆ Inventory Control
### `update_inventory`
Update product stock levels.
**Parameters:**
- `product_id` (integer, required) - Product ID
- `quantity` (integer, required) - Quantity to adjust
- `operation` (string, optional) - Operation type: "set", "add", "subtract"
**Example:**
```json
{
"product_id": 1,
"quantity": 50,
"operation": "add"
}
```
**Response:**
```
โ
ืืืื ืขืืืื: ืกืืืืื ืืืขืืช ืืืจืื ืืช
๐ ืืืื ืงืืื: 150 โ ืืืื ืืืฉ: 200
```
---
### `get_low_stock_alerts`
Get alerts for products with low inventory.
**Parameters:** None
**Response:**
```
โ ๏ธ **ืืชืจืืืช ืืืื ื ืืื:**
๐ก ื ืืื **ืกืืืืื ื ืืืืืช ืื ืืื**
๐ฆ ืืืื ื ืืืื: 8 | ืกืฃ ืืื ืืืื: 10
๐ท๏ธ ืืง"ื: STEV-LIQ-50 | ืงืืืืจืื: ืืืฆืจืื ืืืื ืื
๐ด ืงืจืืื **ืืืงืช ืืคืื ืืืืืืช**
๐ฆ ืืืื ื ืืืื: 0 | ืกืฃ ืืื ืืืื: 5
๐ท๏ธ ืืง"ื: STEV-BAK-200 | ืงืืืืจืื: ืืืฉืื ืืืคืื
```
---
## ๐ Analytics & Reporting
### `get_sales_summary`
Generate sales reports for specified time period.
**Parameters:**
- `days` (integer, optional) - Number of days to analyze (default: 30)
**Example:**
```json
{
"days": 7
}
```
**Response:**
```
๐ **ืกืืืื ืืืืจืืช - 7 ืืืื ืืืจืื ืื**
๐ฐ **ืกื"ื ืืืืจืืช:** โช1,247.50
๐ฆ **ืืกืคืจ ืืืื ืืช:** 15
๐ณ **ืืืืฆืข ืืืื ื:** โช83.17
๐ **ืืืฆืจืื ืืืืืืื:**
1. ืกืืืืื ืืืขืืช ืืืจืื ืืช - 28 ืืืืืืช (โช1,285.20)
2. ืกืืืืื ืืืืืืืช - 22 ืืืืืืช (โช657.80)
3. ืกืืืืื ื ืืืืืช - 15 ืืืืืืช (โช598.50)
๐ **ืืืฆืืขืื ืืคื ืงืืืืจืื:**
โข ืืืจื ืืื: 28 ืืืืืืช (โช1,285.20)
โข ืืืฆืจืื ืืืื ืื: 37 ืืืืืืช (โช1,256.30)
```
---
## โ ๏ธ Error Handling
All tools return error messages in Hebrew with appropriate emoji indicators:
### Common Error Types
**Validation Errors:**
```
โ ืฉืืืื: ืคืืจืื ืืืฆืจืื ืื ืชืงืื. ืืฉืชืืฉ ืืคืืจืื JSON
```
**Not Found Errors:**
```
โ ืื ื ืืฆื ืืงืื ืขื ID: 999
```
**Duplicate Entry Errors:**
```
โ ืฉืืืื: ืืชืืืช ืืืืืื example@test.com ืืืจ ืงืืืืช ืืืขืจืืช
```
**Database Errors:**
```
โ ืฉืืืื ืืงืืืช ืจืฉืืืช ืืืฆืจืื: connection timeout
```
---
## ๐ Response Formats
### Success Responses
- Always include โ
emoji for successful operations
- Provide clear confirmation of what was accomplished
- Include relevant IDs and values for reference
### Data Responses
- Use appropriate emojis for categories (๐๏ธ๐ฆ๐ฅ๐ฐ)
- Format prices with โช symbol
- Include Hebrew text with proper RTL formatting
- Use bullet points and clear structure
### Error Responses
- Always start with โ emoji
- Provide clear, actionable error messages in Hebrew
- Include context about what went wrong
- Suggest corrections when possible
---
## ๐ Integration Examples
### Using with Claude Desktop
Ask Claude natural language questions like:
```
"ืืืกืฃ ืืืฆืจ ืืืฉ: ืกืืืืื ืงืจืืกืืืื, ืืงืืืืจืืืช ืืืจื ืืื, ืืืืืจ 38 ืฉืงืืื"
"ืืืืง ืืืื ืืืฆืจืื ืืกืจืื ืืืืื"
"ืฆืืจ ืืืื ื ืืืฉื ืืืงืื ืืกืคืจ 3 ืขื 2 ืืืืืืช ืืืืืฆืจ ืืจืืฉืื"
"ืชื ืื ืกืืืื ืืืืจืืช ืฉื ืืฉืืืข ืืืืจืื"
```
### Programmatic Usage
```python
import asyncio
from mcp.client import stdio_client
async def add_stevia_product():
async with stdio_client("python", ["src/stevia_store_server.py"]) as client:
result = await client.call_tool("add_product", {
"name": "ืกืืืืื ืคืจืืืื",
"category": "ืืืจื ืืื",
"price": 52.90,
"cost": 28.00,
"description": "ืกืืืืื ืืืืืชืืช ืืืืชืจ",
"sku": "STEV-PREM-001"
})
return result
# Execute
response = asyncio.run(add_stevia_product())
print(response)
```
---
*For more examples and advanced usage, see the [examples/](../examples/) directory.*