{"openapi": "3.0.3", "info": {"title": "Error-actionability translation for MCP tool failures", "version": "0.1.0", "description": "Per-server error-dialect profiles + deterministic verdict classification + host-side gateway enforcement. Provider: TextForAgents LLC. Support: support@textforagents.com"}, "paths": {"/": {"get": {"summary": "Public product descriptor", "responses": {"200": {"description": "Descriptor", "content": {"application/json": {"schema": {"type": "object", "properties": {"product": {"type": "string"}}, "required": []}}}}}}}, "/health": {"get": {"summary": "Health", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "properties": {"status": {"type": "string"}}, "required": []}}}}}}}, "/register": {"post": {"summary": "Register an account", "requestBody": {"content": {"application/json": {"schema": {"type": "object", "properties": {"account_name": {"type": "string"}, "payer_wallet": {"type": "string"}}, "required": ["account_name", "payer_wallet"]}}}}, "responses": {"200": {"description": "Account + claim token", "content": {"application/json": {"schema": {"type": "object", "properties": {"account_id": {"type": "string"}, "claim_token": {"type": "string"}}, "required": []}}}}}}}, "/trial": {"post": {"summary": "Claim the one-time Solo trial (first month free)", "requestBody": {"content": {"application/json": {"schema": {"type": "object", "properties": {"account_id": {"type": "string"}, "claim_token": {"type": "string"}}, "required": ["account_id", "claim_token"]}}}}, "responses": {"200": {"description": "Trial token (shown once)", "content": {"application/json": {"schema": {"type": "object", "properties": {"token": {"type": "string"}, "tier": {"type": "string"}, "trial": {"type": "boolean"}, "expires_at": {"type": "number"}}, "required": []}}}}, "403": {"description": "Trial already used or bad claim"}}}}, "/subscribe": {"post": {"summary": "Subscribe/renew via x402 (Solo 9000000 / Fleet 19000000 atomic USDC)", "parameters": [{"name": "X-PAYMENT", "in": "header", "schema": {"type": "string"}}], "requestBody": {"content": {"application/json": {"schema": {"type": "object", "properties": {"account_id": {"type": "string"}, "tier": {"type": "string"}}, "required": ["account_id", "tier"]}}}}, "responses": {"200": {"description": "Token issued/extended 30 days", "content": {"application/json": {"schema": {"type": "object", "properties": {"token": {"type": "string"}, "tier": {"type": "string"}, "expires_at": {"type": "number"}}, "required": []}}}}, "402": {"description": "x402 payment required / payment rejected"}}}}, "/verdict-check": {"post": {"summary": "Pay-per-call verdict ($0.002 = 2000 atomic USDC, metered from the first check); payment is the credential", "parameters": [{"name": "X-PAYMENT", "in": "header", "schema": {"type": "string"}}], "requestBody": {"content": {"application/json": {"schema": {"type": "object", "properties": {"server": {"type": "string"}, "tool": {"type": "string"}, "mutating": {"type": "boolean"}, "prose": {"type": "string"}, "structured": {"type": "object"}}, "required": ["server", "tool", "mutating", "prose"]}}}}, "responses": {"200": {"description": "Verdict", "content": {"application/json": {"schema": {"type": "object", "properties": {"category": {"type": "string"}, "retryable": {"type": "boolean"}, "retry_after_s": {"type": ["number", "null"]}, "repair_target": {"type": ["string", "null"]}, "replay_safe": {"type": "boolean"}, "action": {"type": "string"}, "source": {"type": "string"}, "prose_sha": {"type": "string"}, "prose_chars": {"type": "integer"}}, "required": []}}}}, "402": {"description": "x402 payment required / payment rejected"}}}}, "/classify": {"post": {"summary": "Classify a failure + learn the dialect profile (Bearer token)", "security": [{"BearerAuth": []}], "requestBody": {"content": {"application/json": {"schema": {"type": "object", "properties": {"server": {"type": "string"}, "tool": {"type": "string"}, "mutating": {"type": "boolean"}, "prose": {"type": "string"}, "structured": {"type": "object"}}, "required": ["server", "tool", "mutating", "prose"]}}}}, "responses": {"200": {"description": "Verdict", "content": {"application/json": {"schema": {"type": "object", "properties": {"category": {"type": "string"}, "retryable": {"type": "boolean"}, "retry_after_s": {"type": ["number", "null"]}, "repair_target": {"type": ["string", "null"]}, "replay_safe": {"type": "boolean"}, "action": {"type": "string"}, "source": {"type": "string"}, "prose_sha": {"type": "string"}, "prose_chars": {"type": "integer"}}, "required": []}}}}, "401": {"description": "Missing/expired token"}, "403": {"description": "Tier server limit reached"}}}}, "/enforce": {"post": {"summary": "Gateway enforcement round: refused-without-forwarding on a prior non-retryable verdict for identical args, else classify+record (Bearer token)", "security": [{"BearerAuth": []}], "requestBody": {"content": {"application/json": {"schema": {"type": "object", "properties": {"server": {"type": "string"}, "tool": {"type": "string"}, "mutating": {"type": "boolean"}, "args": {"type": "object"}, "prose": {"type": "string"}, "structured": {"type": "object"}}, "required": ["server", "tool", "mutating", "args", "prose"]}}}}, "responses": {"200": {"description": "Enforcement result + verdict", "content": {"application/json": {"schema": {"type": "object", "properties": {"enforced": {"type": "boolean"}, "forwarded": {"type": "boolean"}, "verdict": {"type": "object", "properties": {"category": {"type": "string"}, "retryable": {"type": "boolean"}, "retry_after_s": {"type": ["number", "null"]}, "repair_target": {"type": ["string", "null"]}, "replay_safe": {"type": "boolean"}, "action": {"type": "string"}, "source": {"type": "string"}, "prose_sha": {"type": "string"}, "prose_chars": {"type": "integer"}}, "required": []}}, "required": []}}}}, "401": {"description": "Missing/expired token"}}}}, "/profiles": {"get": {"summary": "Per-server dialect profiles for this account (Bearer token)", "security": [{"BearerAuth": []}], "responses": {"200": {"description": "Profiles", "content": {"application/json": {"schema": {"type": "object", "properties": {"servers": {"type": "object"}, "total_profiles": {"type": "integer"}}, "required": []}}}}, "401": {"description": "Missing/expired token"}}}}, "/stats": {"get": {"summary": "Verdict mix / dialect hit rate / enforcement counts (Bearer token)", "security": [{"BearerAuth": []}], "responses": {"200": {"description": "Stats", "content": {"application/json": {"schema": {"type": "object", "properties": {"verdict_counts": {"type": "object"}, "blocked_resends": {"type": "integer"}}, "required": []}}}}, "401": {"description": "Missing/expired token"}}}}, "/mcp": {"post": {"summary": "MCP gateway surface (streamable-http JSON-RPC: initialize, ping, tools/list, tools/call; Bearer token)", "security": [{"BearerAuth": []}], "requestBody": {"content": {"application/json": {"schema": {"type": "object", "properties": {"jsonrpc": {"type": "string"}, "id": {"type": "integer"}, "method": {"type": "string"}, "params": {"type": "object"}}, "required": []}}}}, "responses": {"200": {"description": "JSON-RPC response", "content": {"application/json": {"schema": {"type": "object", "properties": {"jsonrpc": {"type": "string"}, "id": {"type": "integer"}, "result": {"type": "object"}}, "required": []}}}}, "401": {"description": "Missing/expired token"}}}}, "/tokens/revoke": {"post": {"summary": "Revoke the caller's token", "security": [{"BearerAuth": []}], "responses": {"200": {"description": "Revoked", "content": {"application/json": {"schema": {"type": "object", "properties": {"revoked": {"type": "boolean"}}, "required": []}}}}}}}, "/package": {"get": {"summary": "Gateway package (wheel) download", "responses": {"200": {"description": "Wheel file"}}}}}, "components": {"securitySchemes": {"BearerAuth": {"type": "http", "scheme": "bearer"}}, "schemas": {"Verdict": {"type": "object", "properties": {"category": {"type": "string"}, "retryable": {"type": "boolean"}, "retry_after_s": {"type": ["number", "null"]}, "repair_target": {"type": ["string", "null"]}, "replay_safe": {"type": "boolean"}, "action": {"type": "string"}, "source": {"type": "string"}, "prose_sha": {"type": "string"}, "prose_chars": {"type": "integer"}}, "required": []}}}}