The orgrelay-connector/1 spec
The contract between your system and OrgRelay, on one page. It is deliberately small: a manifest that lists your tools, a naming rule, a read/write flag, and a handful of conventions for errors, paging and time.
The machine-readable versions live in the developer kit's spec/ folder: connector-manifest.schema.json, event.schema.json, orgrelay-rest.openapi.yaml and standard-tools.json. This page explains them. If you only want to see them working, the quickstart runs a template that implements every rule here.
The manifest
The manifest says who you are and which tools you offer. Where it lives depends on the transport:
- Over MCP, return it from
resources/readas the resourceorgrelay://connector/manifest. - In REST compatible mode, serve it at
GET {base}/manifest.
| Field | Required | Notes |
|---|---|---|
spec |
yes | Always "orgrelay-connector/1" |
name |
yes | A string, or { "zh-CN", "zh-TW", "en", "id" }. All four are recommended because OrgRelay's interface runs in those languages |
description |
no | One sentence, same language rules |
version |
recommended | Your connector's version, for example 1.2.0 |
vendor |
no | Who built it |
logo |
no | https:// URL or a data:image/...;base64, URI. PNG, JPEG, WebP or SVG, 200 KB or less. OrgRelay downloads and caches it when binding; it never hot-links |
auth |
no | Defaults for the admin screen: { type, token_url, scopes }. See authentication |
events |
no | Event types you may push, such as orders.created. See events |
tools |
yes | 1 to 100 tools |
A minimal manifest:
{
"spec": "orgrelay-connector/1",
"name": { "en": "Sample ERP", "zh-CN": "示例 ERP" },
"version": "1.0.0",
"auth": { "type": "bearer" },
"events": ["orders.created", "inventory.low_stock"],
"tools": [
{
"name": "orders.search",
"access": "read",
"title": { "en": "Search orders" },
"description": "Search orders by status or customer. Returns order_no, status, customer and total, newest first.",
"inputSchema": {
"type": "object",
"properties": {
"status": { "type": "string", "enum": ["pending", "paid", "shipped"] },
"cursor": { "type": "string" },
"limit": { "type": "integer", "minimum": 1, "maximum": 100 }
}
}
}
]
}Tools
| Field | Required | Notes |
|---|---|---|
name |
yes | domain.action in lower case. Domain 2–24 characters, action 2–40. Example: orders.search |
access |
yes | read or write. Anything that changes data is write |
title |
recommended | Human-readable, may be a four-language object |
description |
recommended | When to use the tool and what it returns. The AI chooses tools from this text, so be specific |
inputSchema |
yes | JSON Schema with type: "object". Property names use letters, digits, _ . - |
outputSchema |
recommended | JSON Schema of the result |
Over MCP, inputSchema goes in tools/list and annotations.readOnlyHint must agree with access. If they disagree, OrgRelay treats the tool as write. That is the safe direction: a mislabelled tool costs an approval, never an unapproved change.
Name tools after the standard domains
Fourteen domains have recommended names: orders, inventory, products, customers, purchase, logistics, finance, hr, tickets, seo, ads, content, tasks and reports. Using them lets OrgRelay route tools to department agents without configuration: the sales agent gets orders.* and customers.*, the warehouse gets inventory.*. The full list with input and output fields is on standard tools. For anything else, follow the same pattern, for example quality.inspections.
Write good descriptions
The description is the only thing the AI reads when deciding which tool to call. Compare:
| Weak | Better |
|---|---|
| "Get orders" | "Search orders by status, customer or date range. Returns order_no, status, customer, total and channel, newest first, 20 per page." |
| "Update stock" | "Adjust on-hand stock for one SKU after a count. delta may be negative. Requires reason. Idempotent." |
Calling conventions
MCP. Streamable HTTP, protocol version 2025-06-18 (2025-03-26 compatible). OrgRelay passes context in tools/call params._meta: orgrelay/actor with the person's id, name, role and department; orgrelay/approval_id and orgrelay/idempotency_key on approved write calls. Return results in structuredContent and a JSON copy in content. Details on the MCP transport page.
REST. POST {base}/tools/{name} with { "arguments": { ... } }. The same context travels in headers: Idempotency-Key, X-OrgRelay-Actor (base64url JSON) and X-OrgRelay-Approval-Id. Details on REST compatible mode.
Error codes
| code | REST status | MCP | Meaning |
|---|---|---|---|
invalid_arguments |
422 or 400 | JSON-RPC -32602 or isError |
Missing, wrong type or invalid argument |
unknown_tool |
404 | JSON-RPC -32602 |
No such tool |
not_found |
404 | isError |
Record not found |
unauthorized |
401 | HTTP 401 | Token invalid or revoked |
forbidden |
403 | HTTP 403 | Token valid, permission missing |
conflict |
409 | isError |
State does not allow it, for example already shipped |
idempotency_conflict |
409 | isError |
Same idempotency key, different arguments |
rate_limited |
429 with Retry-After |
HTTP 429 | Slow down |
upstream_error |
502 | isError |
Something your system depends on failed |
internal_error |
500 | isError |
Anything else |
message is shown to people. It must not contain stack traces, SQL, file paths or tokens; the security page lists what else to keep out. OrgRelay passes 4xx business errors through to the AI and the user. Timeouts, 5xx and network errors count as failures. After three in a row, OrgRelay stops calling your connector for 60 seconds.
Pagination
List tools accept cursor (omit it on the first page) and limit (default 20, maximum 100). They return { "items": [...], "next_cursor": "..." | null } and may add total. OrgRelay treats cursors as opaque strings, so an offset, a database key or a vendor's own cursor are all fine.
Timeouts, limits and size
- OrgRelay waits up to 20 seconds per call. Aim for 95% of calls under 2 seconds and none over 5. For long jobs, return a job id and provide a second tool that fetches the result.
- By default OrgRelay sends at most 120 calls per minute per connection. Answering
429withRetry-Afteris fine and does not count as a failure. - At most 100 tools. Keep each result under about 100 KB; the AI sees roughly the first 12,000 characters.
Money and time
- Money is
{ "amount": 18600, "currency": "CNY" }, with ISO 4217 currency codes. - Dates are
YYYY-MM-DD. - Timestamps are ISO 8601 with an offset:
2026-11-09T10:00:00+08:00.
Versioning
The spec version is the manifest's spec value. Within orgrelay-connector/1, only backward-compatible changes are made: new optional fields, tools, error codes and event types. OrgRelay ignores fields it does not know.
For your own connector:
- Adding tools or optional arguments is safe. Bump the minor version. When the owner clicks Test connection, new tools appear switched on, and the owner can switch them off.
- Never rename a tool, remove an argument, change its meaning or turn a read tool into a write tool. Add
orders.search_v2and keep the old tool for at least six months, marked deprecated in its description. - When
orgrelay-connector/2arrives, OrgRelay will support both for at least 12 months. Changes are announced on the changelog.
Common questions
Is the manifest the same as tools/list? No. tools/list is standard MCP. The manifest adds what MCP does not carry: read or write per tool, a four-language name, auth defaults and event types.
What if readOnlyHint and the manifest disagree? The tool is treated as write and goes through approval. The self-test tool reports it as a failure.
Can I add tools later? Yes, see versioning above.
Next
- Run the self-test against your implementation.
- Read how write tools and approvals interact.
- Start from a template instead of a blank file.
- How the business owner controls which roles can use each tool is explained on orgrelay.com's integrations page.
- Start from a template that already follows every rule on this page.
- Pick a transport: MCP or REST compatible mode.
- When the API already exists, generate tools instead: OpenAPI import or GraphQL import.
- How staff reach your tools from their own AI client: MCP overview.
Related pages
- Enterprise patterns: permissions, offboarding and data residency.
- Human-in-the-loop: why approvals live outside the AI client.