Skip to main content

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​

NameInTypeDescriptionNotes
AiToolsAddCustomServerRequestbodyAiToolsAddCustomServerRequest[required]

Responses​

Status codeDescriptionTypeResponse headers
200Whether the server was registered, with the stored entry.AiToolsMutationResult-
400The server name is missing or is not routable.AiErrorResponse-
401Missing asc_auth_key cookie or Authorization header.AiErrorResponse-
403AI 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-
404The 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-
413The request body is larger than 100 KB, the JSON parser's limit on this route.AiErrorResponse-
500Unhandled failure. The reason is logged server-side and never echoed back.AiErrorResponse-

Return type​

AiToolsMutationResult

Authorization​

cookieAuth, bearerAuth

HTTP request headers​

  • Content-Type: application/json
  • Accept: application/json