API & MCP

Everything a person can do on Sortbay Inbox Triage Rules, a program or AI agent can do with the same inputs and get the identical result.

HTTP API

  • POST https://sortbaytriagerules.usefulweb.app/api/v1/calculate – run Sortbay Inbox Triage Rules
  • GET https://sortbaytriagerules.usefulweb.app/api/v1/tool – inputs, output schema, examples
  • OpenAPI 3.1: /openapi.json · /openapi.yaml
  • Errors: application/problem+json; 422 includes per-field errors.

Sortbay Inbox Triage Rules

Runs deterministic triage rules — conditions on sender, recipients, subject, text, attachment names or source, actions that add labels, assign, set a status or a due date — over e-mails from an .eml/.mbox file and explains for every message which rule matched and what it set. The same evaluator sorts new mail in the Sortbay shared inbox.

Inputs of Sortbay Inbox Triage Rules
FieldTypeDefaultDescription
sourcetextarea"From maria.lopez@example.com Mon Nov 30 09:12:44 2026\nFrom: \"Maria Lopez\" <mE-mail source (.eml text) or mbox. Paste the full source of a message (headers, a blank line, then the body) — in most mail programs “Show original” or “View source”. Several messages: paste an mbox (each starts with a “From ” line).
filefile—E-mail file (.eml or .mbox, optional). Up to 10 MB. Used instead of the pasted text when given. Export single mails as .eml or a folder as .mbox from your mail program.
rulestextarea"[\n {\n \"name\": \"Invoices to accounts\",\n \"match\": \"all\",\n \"conditRules (JSON list). Each rule: name, match (all | any), conditions [{ field, op, value }], actions { labels, assignee, status (open | waiting | done), dueInDays, stop }. Fields: from, to, subject, body, text, attachment, source. Comparisons: contains, not_contains, equals, starts_with, ends_with, domain_is, any_word, is_empty, has_attachment.
todaytext"2026-12-02"Today (YYYY-MM-DD, base for due dates of undated mail)

Example request

Support, invoice and sales mail

curl -X POST https://sortbaytriagerules.usefulweb.app/api/v1/calculate -H 'content-type: application/json' -d '{}'

Every result contains

inputs (normalised, defaults applied), summary, result (validated against the published schema), units, assumptions, sources, warnings, computedAt and links.

MCP (Model Context Protocol)

  • Streamable HTTP endpoint: https://sortbaytriagerules.usefulweb.app/mcp – protocol revisions 2026-07-28 (stateless) and 2025-11-25 / 2025-06-18 / 2025-03-26 (initialize handshake).
  • Tools: sortbay_triage_rules
  • Local stdio connector: node src/mcp-stdio.ts --tool=sortbay-triage-rules
{
  "mcpServers": {
    "sortbay-triage-rules": { "type": "http", "url": "https://sortbaytriagerules.usefulweb.app/mcp" }
  }
}