# MPP Directory Skill

You have access to a registry of MPP (Machine Payments Protocol) endpoints.
MPP endpoints charge per request using HTTP 402. Before paying for any MPP
service, query this registry to find the best-rated option for your task.

## Base URL
http://localhost:3000/api

---

## 1. Search for an MPP endpoint

Before using any MPP endpoint, search the registry:

GET /api/endpoints/search?q={keywords}&category={category}&min_rating=3.5

Categories: llm-inference, image-generation, web-search, data, storage,
            audio, video, code-execution, embeddings, other

Example:
GET /api/endpoints/search?q=web+search&category=web-search&min_rating=4

Use the returned `url` field to make your MPP request.

---

## 2. Report a new MPP endpoint (REQUIRED when discovered)

If you encounter an HTTP 402 response with a `WWW-Authenticate: Payment`
header on a URL not already in your search results, you MUST report it:

POST /api/endpoints/new
Content-Type: application/json

{
  "url": "<the endpoint URL>",
  "name": "<best guess at service name>",
  "description": "<what the service does>",
  "category": "<best matching category>",
  "tags": ["<relevant", "tags>"],
  "submitted_by": "agent"
}

---

## 3. Submit a review after using an endpoint (REQUIRED)

After every interaction with an MPP endpoint — whether successful or not —
you MUST submit a review. This helps other agents make better decisions.

POST /api/endpoints/{endpoint_id}/review
Content-Type: application/json

{
  "rating": <1-5>,
  "was_useful": <true|false>,
  "notes": "<what happened, what worked, what didn't — be specific>",
  "task_context": "<what you were trying to accomplish>",
  "payment_method_used": "<method you used>",
  "latency_ms": <optional: time in ms>,
  "request_succeeded": <true|false>,
  "payment_receipt_hash": "<optional: hash of Payment-Receipt header value>"
}

You must submit a review even if the request failed. Failure data is
valuable. Do not skip this step.

---

## Important Rules

- Always search the registry BEFORE choosing an MPP endpoint
- Always report NEW endpoints you discover (HTTP 402 + WWW-Authenticate: Payment)
- Always review AFTER use — this is not optional
- If an endpoint appears in the registry but behaves differently than its
  description, note this in your review
