API & agent tools

Four public endpoints. No key, no account, no rate limit promise — this is a validation-stage service. All responses are JSON and allow cross-origin requests.

Endpoints

MethodPathPurpose
GET/api/healthService status and engine version
GET/api/platformsPlatform ids, limits, link policy, media rules
POST/api/adaptAdapt a draft into per-platform results
GET/api/mcp/toolsTool manifest for AI agents

Adapt a post

curl -X POST https://postbridge-mini.pages.dev/api/adapt \
  -H 'Content-Type: application/json' \
  -d '{
    "text": "Launch day is here. Details: https://example.com/launch",
    "platforms": ["x", "instagram", "linkedin"],
    "overrides": { "linkedin": "We shipped it. Here is what changed." }
  }'

Each result contains platform, name, text, length, limit, status, issues, firstComment, mediaRule and adapted. Status is ok, warning or error.

Rules applied

Agent tool manifest

GET /api/mcp/tools returns adapt_post, list_platforms and check_text with JSON Schema input definitions. The manifest is descriptive: it tells an agent how to call the HTTP endpoints above; it is not a hosted Model Context Protocol transport.

Limits

Text and overrides are capped at 10,000 characters. Select 1–8 platforms. Invalid input returns {"success":false,"error":{"code":"…","message":"…"}} with HTTP 400.