aiToolsAddCustomServer
AiToolsMutationResult aiToolsAddCustomServer(AiToolsAddCustomServerRequest)
POST /api/2.0/ai/tools/add-custom-server
Add custom server
Registers a custom MCP server under the given name so the model may call its tools. The name becomes a URL path segment, so it may not be ., .., or contain a path separator or a control character. config may be omitted in two cases: a name matching a host-configured system server pins the entry to that server's canonical settings as a whitelist marker, and a name already registered portal-wide copies the portal-level configuration into this scope; anything else without a config is rejected. entityId scopes the registration and has to name a room the caller can open - a room that is not an agent room folds to the portal-wide scope, while an unreachable one is refused so it cannot silently rewrite the portal's own registry.
Parameters
| Name | In | Type | Description | Notes |
|---|---|---|---|---|
| AiToolsAddCustomServerRequest | body | AiToolsAddCustomServerRequest | [required] |
Responses
| Status code | Description | Type | Response headers |
|---|---|---|---|
| 200 | Whether the server was registered, with the stored entry. | AiToolsMutationResult | - |
| 400 | The server name is missing or is not routable. | AiErrorResponse | - |
| 401 | Missing asc_auth_key cookie or Authorization header. | AiErrorResponse | - |
| 403 | AI is disabled for this portal, the caller is a guest, or the room named by entityId is one the caller cannot open. Relayed from the DocSpace AI service or the Files API. | AiErrorResponse | - |
| 404 | The referenced object does not exist: an unknown or deleted room named by entityId, or an object the caller cannot read - for those the two cases are deliberately indistinguishable. | AiErrorResponse | - |
| 413 | The request body is larger than 100 KB, the JSON parser's limit on this route. | AiErrorResponse | - |
| 500 | Unhandled failure. The reason is logged server-side and never echoed back. | AiErrorResponse | - |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json