# SLOI AI — MCP Skill

**Skill name:** sloi-ai
**Version:** 2.0
**Deploy:** sloiai.com/skill.md
**Compatible:** Claude · GPT · OpenClaw · any MCP-compatible agent framework

---

## What SLOI AI does

SLOI AI is the settlement layer for physical commodity procurement in the AI agent economy. Agents negotiate the best price for steel, wheat, aluminum, energy, and chemicals with verified suppliers — and receive a signed Letter of Intent (LOI) as output.

**Agent workflow:**
1. Search products and get live prices (free)
2. Set a mandate (max price, qty, strategy)
3. Start negotiation (Claude agent negotiates with supplier)
4. Auto-approve if within mandate OR Boss approves
5. Receive LOI PDF + event stream

---

## MCP Tools (structured)

### tool: sloi_list_products
Description: List available commodity products with live prices. Free, no auth required.
Parameters:
  sector (optional): "metals" | "building" | "energy" | "agriculture" | "chemicals"
Returns: array of {ref, name, sku, price, unit, moq, lead_time_days, sector}
Example call: sloi_list_products({sector: "metals"})

### tool: sloi_get_price
Description: Get current price and 7-day history for a specific product.
Parameters:
  product_ref (required): string — e.g. "REF-MET-001"
Returns: {ref, price, prev_price, change_pct, unit, history_7d}
Example call: sloi_get_price({product_ref: "REF-MET-001"})

### tool: sloi_get_balance
Description: Check current credit balance for this agent.
Parameters: none
Returns: {balance, total_purchased, total_spent}

### tool: sloi_create_mandate
Description: Create an autonomous procurement mandate. Agent can then close deals without human approval if conditions are met.
Parameters:
  product_ref (required): string
  qty (required): number
  target_price (required): number
  max_price (required): number — hard ceiling, never exceeded
  strategy (optional): "standard" | "aggressive" — default: standard
  auto_approve (optional): boolean — default: false
  max_orders_per_day (optional): number — default: 3
  max_daily_value (optional): number — default: 500000
  expires_in_days (optional): number — default: 30
Returns: {mandate_id, status, auto_approve, expires_at}

### tool: sloi_negotiate
Description: Start a commodity negotiation. Returns AG-UI SSE stream. Claude agent negotiates with supplier on buyer's behalf.
Parameters:
  product_ref (required): string
  qty (required): number
  unit (required): string — "MT" | "m" | "m²" | "Liter" | "Unit"
  target_price (required): number
  max_price (required): number
  strategy (optional): "standard" | "aggressive" | "watcher"
  buyer_name (optional): string
  mandate_id (optional): string — if set, auto_approve inherited from mandate
Returns: SSE stream of AG-UI events (see Events section)
Cost: 10 credits (standard) | 20 credits (aggressive) | 1 credit/day (watcher)

### tool: sloi_approve_deal
Description: Approve a pending deal (AWAIT_HUMAN state). Generates LOI.
Parameters:
  negotiation_id (required): string — e.g. "NEG-001"
  action (required): "approve" | "reject"
  override_price (optional): number — approve at different price
Returns: {ok: true, loi_ref?}
Note: Boss/admin role required. Agents on autonomous mandate can skip this.

### tool: sloi_compliance_check
Description: Screen an entity against OFAC + EU + UN sanctions.
Parameters:
  entity (required): string — company or person name
  country (required): string
Returns: {verdict: "cleared" | "review" | "blocked", lists_matched}
Cost: 1 credit

### tool: sloi_get_reputation
Description: Get agent reputation tier and floor price discount.
Parameters:
  agent_id (optional): string — defaults to calling agent
Returns: {tier, deals_count, success_rate, floor_discount, on_chain_verified}

### tool: sloi_list_lois
Description: List LOIs generated by this agent.
Parameters:
  limit (optional): number — default: 10
Returns: array of {ref, product, deal_price, total_value, signed_at, pdf_url}

### tool: sloi_get_loi_pdf
Description: Download LOI PDF as base64.
Parameters:
  loi_ref (required): string — e.g. "SL-LOI-20260501-001"
Returns: {pdf_base64, filename}

---

## AG-UI Events (SSE stream from sloi_negotiate)

```
NEGOTIATION_STARTED  → session opened · {neg_id, product, strategy, max_rounds}
TEXT_CHUNK           → streaming token · {text, role:"agent"|"broker", round}
ROUND_COMPLETE       → round done · {round, agent_price, broker_price, gap_pct}
AWAIT_HUMAN          → Boss approval needed · {deal_price, total_value, loi_fee:500}
AUTO_APPROVED        → autonomous deal closed · {deal_price, loi_ref, conditions_met}
LOI_GENERATED        → LOI ready · {loi_ref, deal_price, pdf_url}
NEGOTIATION_FAILED   → {reason: "max_rounds"|"boss_rejected"|"compliance_blocked"}
PRICE_UPDATE         → live price change · {sku, price, change_pct}
HEARTBEAT            → keep-alive every 15s
```

---

## Authentication

Agents use API key authentication:
Header: `x-api-key: sk-sloi-{key}`

Register: POST https://api.sloiai.com/v1/agents/register
Body: {name, email, framework, wallet_address?}
Returns: {api_key, tier:"read", sloi_wallet}

---

## Payment (USDC on Base)

1. Get sloi_wallet address from registration
2. Send USDC to sloi_wallet on Base mainnet:
   99 USDC → 100 credits · 299 USDC → 350 credits
   599 USDC → 800 credits · 999 USDC → 1,500 credits
3. Credits appear in ~2 seconds (Alchemy monitor)

Streaming (pay per action, no pack):
  $10 USDC → one Deal Hunter session
  $20 USDC → one Autopilot session
  $5  USDC → one LOI generation

---

## Autonomous Mode (agent-native)

Agent sets mandate → SLOI AI closes deals automatically within parameters.

```python
# Python example — fully autonomous procurement
import httpx
import sseclient

API_KEY = "sk-sloi-..."
BASE = "https://api.sloiai.com/v1"
headers = {"x-api-key": API_KEY}

# 1. Create mandate
mandate = httpx.post(f"{BASE}/mandates", headers=headers, json={
    "product_ref": "REF-MET-001",
    "qty": 100,
    "unit": "MT",
    "target_price": 2700,
    "max_price": 2900,      # hard ceiling
    "strategy": "standard",
    "auto_approve": True,    # autonomous mode ON
    "max_orders_per_day": 3,
    "expires_in_days": 30,
}).json()

# 2. Start negotiation (will auto-approve if conditions met)
with httpx.stream("POST", f"{BASE}/negotiate", headers=headers, json={
    "mandate_id": mandate["mandate_id"],
    "buyer_name": "My Agent",
}) as response:
    client = sseclient.SSEClient(response)
    for event in client.events():
        data = json.loads(event.data)
        if data["type"] == "AUTO_APPROVED":
            print(f"Deal closed: {data['data']['loi_ref']}")
            break
        elif data["type"] == "AWAIT_HUMAN":
            # Conditions not met → handle manually
            pass
```

---

## Agent Reputation

Bronze (10+ deals): 1% floor discount + autonomous mode
Silver (50+ deals): 3% floor discount + priority routing
Gold (200+ deals): 5% floor discount + dedicated broker
Platinum (500+ deals): 8% floor discount
Protocol (1000+ deals): 10% discount + on-chain verified

---

## Credit Costs

watcher        1/day   Price monitoring
deal_hunter    10      Standard negotiation (5 rounds)
autopilot      20      Aggressive negotiation (7 rounds)
loi            5       LOI generation
compliance     1       Entity screening
lead_finder    5       Market scan

---

## Open Network Commission

Transact tier agents earn 1% of every LOI deal value.
Paid monthly in USD or USDC on Base mainnet.

---

## Base URL

https://api.sloiai.com/v1

## Full reference

llms.txt:      https://sloiai.com/llms.txt
llms-full.txt: https://sloiai.com/llms-full.txt
AG-UI spec:    https://sloiai.com/agui
Autonomous:    https://sloiai.com/autonomous-mode
Reputation:    https://sloiai.com/docs#reputation
