API Reference
Complete reference for Pharos MCP tools: schema discovery, read operations, write operations, and analysis.
Tool Categories
Pharos exposes tools in four categories:
| Category | Tools | Description | |----------|-------|-------------| | Schema | 8 | Table search, column exploration, relationship mapping | | Read | 25+ | KPI queries, MRP status, customer data, inventory health | | Write | 10+ | Labour posting, inventory adjustments, warehouse transfers | | Analysis | 8 | MRP comparison, demand tracing, trend analysis |
Schema Tools
schema_search
Search for database tables matching a keyword.
curl -s -X POST .../mcp/tools/schema_search \
-H "Authorization: Bearer $PHAROS_TOKEN" \
-d '{"query": "customer"}'
Parameters:
query(string, required): Search keyword
Response:
{
"tables": [
{
"name": "ArCustomer",
"description": "Customer master: account, terms, credit limit",
"rows": 1247,
"key_columns": ["Customer", "Name", "CreditLimit"]
}
],
"total_matches": 3
}
schema_columns
Get column details for a specific table.
Parameters:
table(string, required): Table namefilter(string, optional): Filter column names
Read Tools
kpi_dashboard
Retrieve production KPI metrics for a given period.
curl -s -X POST .../mcp/tools/kpi_dashboard \
-H "Authorization: Bearer $PHAROS_TOKEN" \
-d '{"period": "2026-03"}'
Parameters:
period(string, required): ISO month (YYYY-MM)
Response:
{
"period": "2026-03",
"metrics": {
"production_efficiency": { "value": 87.3, "target": 90.0, "unit": "%" },
"on_time_delivery": { "value": 94.1, "target": 95.0, "unit": "%" },
"scrap_rate": { "value": 2.1, "target": 3.0, "unit": "%" },
"oee": { "value": 78.5, "target": 80.0, "unit": "%" }
}
}
mrp_status
Get current MRP suggestion status.
Parameters:
filter(string, optional):"all","actionable","overdue"
customer_risk
Assess customer credit and payment risk.
Parameters:
customer(string, optional): Specific customer code, or omit for all at-risk
inventory_health
Check inventory levels against reorder points.
Parameters:
warehouse(string, optional): Warehouse codecategory(string, optional): Stock category filter
Write Tools
All write operations require read-write permission level and include a confirmation step.
post_labour
Post labour hours against a work order operation.
curl -s -X POST .../mcp/tools/post_labour \
-H "Authorization: Bearer $PHAROS_TOKEN" \
-d '{"work_order": "WO-4521", "operation": 20, "hours": 4.5, "qty_complete": 12}'
Parameters:
work_order(string, required): Work order numberoperation(integer, required): Operation sequence numberhours(number, required): Hours to postqty_complete(integer, required): Quantity completed
Response:
{
"status": "confirmed",
"transaction_id": "LAB-2026-03-04-0891",
"work_order": "WO-4521",
"timestamp": "2026-03-04T14:32:11Z"
}
inventory_adjustment
Adjust inventory quantities (positive or negative).
Parameters:
item(string, required): Stock codewarehouse(string, required): Warehouse codequantity(number, required): Adjustment quantityreason(string, required): Adjustment reason code
Analysis Tools
mrp_compare
Compare two MRP runs to identify changes in suggestions.
Parameters:
run_a(string, required): First MRP run IDrun_b(string, required): Second MRP run ID
demand_trace
Trace the demand source for a specific MRP suggestion.
Parameters:
item(string, required): Stock codesuggestion_id(string, optional): Specific suggestion to trace
Error Handling
All tools return errors in a consistent format:
{
"error": {
"code": "INVALID_PARAMETER",
"message": "Parameter 'period' must be in YYYY-MM format",
"parameter": "period"
}
}
Common error codes: UNAUTHORIZED, INVALID_PARAMETER, NOT_FOUND, WRITE_DENIED, DATABASE_ERROR.