create_collection
Creates a new documentation collection in the organization together with its invisible root page (type 0), auto-assigns collection permissions to all org users based on their roles, and auto-provisions an MCP server for it in the background. The returned rootParentId is the page id under which top-level pages are created (via Create Page). SSO read-only organizations that already have a collection get 403. Slug is permanent; if omitted it is derived from the name. A chosen slug that is taken returns 409, and a chosen slug that is one of docstar-cli's own commands (reserved) returns 400. A body that fails validation returns 400 with the Joi message. Body fields:
name (string, required) - Collection name, 3-55 characters. If the organization already has a collection with the same name (or a name like "name_N"), a numeric suffix is appended to the stored name (for example "Docs_2") instead of an error.
slug (string, optional) - Permanent URL-safe identifier: lowercase letters, numbers and underscores only (no hyphens or spaces; 2-50 chars). Cannot be changed later. It is what docstar-cli (docstar-cli ...) and the MCP URL are built on, so these reserved words can't be chosen (400 "This slug is reserved, please choose another one"): alias, auth, clean, complete, completion, completion-script, config, help, init, key, list, login, logout, mcp. If omitted it is derived from the name (every run of other characters becomes an underscore), with a random suffix added when that slug is already taken or reserved.
description (string, optional) - Collection description (null or empty allowed).
isPublic (boolean, optional) - Accepted but ignored on create: a new collection is always created with isPublic true. Use Update Collection to change it.
type (string, optional) - Collection type: 'page' (default, documentation pages), 'api' (API reference), 'blog', or 'embed'.
customDomain (string, optional) - Custom domain to serve the public docs on, e.g. docs.example.com. Must be unique.
path (string, optional) - Path prefix under the custom domain, e.g. 'api'.
theme (string, optional) - Theme/brand color hex string, default '#f2994a'.
favicon (string, optional) - Favicon URL.
gtmId (string, optional) - Google Tag Manager ID.
docProperties (object, optional) - Free-form doc settings object, e.g. {"languages":["hi","fr"]} for AI translations.
environment (object, optional) - Accepted but ignored on create: the stored environment is always null. Set it with Update Collection.
meta (object, optional) - Free-form metadata object.
orgDetails (object, optional) - Organization display details object (overwritten with the organization name on create).
runCollection (object, optional) - Landing page (run collection) data object.
uniqueTabId (string, optional) - Optional browser tab id used only to suppress the realtime socket echo to the calling tab; agents can omit it. POST https://api.docstar.io/orgs/:orgId/collections
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"orgId": "<orgId>"
},
"name": "create_collection"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | e.g. Payments API Docs | |
| slug | No | e.g. payments_api_docs | |
| type | No | e.g. api | |
| orgId | Yes | The orgId path variable | |
| description | No | e.g. Public docs for the Payments API |