CollHub

v1.8.2
com.collhub/collhub Checked 3 days ago Published 3 days ago

Documents, projects, comments, workflows and data sources of your CollHub instance, as tools.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

whoami

Who the server is logged in as on the instance: `user` (email, name) first, then the session (the host profile it belongs to) and the account (id, privileges, memberships). Answer a "who am I logged in as" question with the email.

login

Log in to the instance in the browser — only when the user asks. Plain: resumes the stored session, opens a browser only when there is none, and keeps the account this host was logged in as — when the browser is signed in as someone else, the login page asks the user which account to keep. `switch_user`, the only way to change account: opens the browser on the login form (signing the browser out first), so a different account can be entered even when the browser is already signed in; the previous session ends once the new login has landed, so a switch that fails leaves the user logged in a…

ParameterTypeDescription
switch_userbooleanEnd the current session first and ask for a (possibly different) account

logout

Sign out of the instance — only when the user asks. Ends this host's session on the backend and forgets it here; the user's other sessions and the app stay signed in. The next call to that instance opens a browser login for the same account (another one is refused); `login` with `switch_user` changes account.

list_principals

Users and groups — the directory behind principal-typed fields such as a Task's `assignee`, which accept a name on write but store a numeric id. `query` (case-insensitive substring of username, first/last name, email or group name) turns "luca" into the id; `ids` labels ids read back from a document. One id space for both. Only users, teams and dynamic teams can hold an assignment. Capped per kind at `limit` (default 100, max 500): truncated: true + truncated_kinds says a kind has more.

ParameterTypeDescription
idsarrayResolve these principal ids to names — the reverse lookup for an id read out of a document (e.g. metadata["type:assignee"]). Combines with `query` as an additional restriction.
limitintegerMaximum principals per kind (default 100).
querystringCase-insensitive substring of a name (username, first/last name or email for users; name for groups). Omit to list everything.
typestringWhich kinds to return (default "all"). "group" covers teams, dynamic teams and roles.

list_collections

List available collections. Use this first to discover collection IDs before searching or browsing documents.

ParameterTypeDescription
querystringCase-insensitive substring of the collection name. Omit to list every collection

get_collection

Get full details of a collection including permissions and configuration. Its `instructions`, when set, say how documents there are written and handled: follow them for every document of the collection.

ParameterTypeDescription
collection_id *numberCollection ID

create_collection

Create a new collection. Collections group related documents with custom metadata schemas. Private and hierarchical by default: pass is_private=false only for a collection every user should see, is_hierarchical=false only for a flat one.

ParameterTypeDescription
name *stringCollection name
descriptionstringCollection description
instructionsstringGuidance for AI agents working with this collection — how its documents are written and handled. In-app agents receive it with the collection; here get_collection shows it
is_hierarchicalbooleantrue (default): folders and projects can be created in it. false makes a flat collection, which update_collection can convert to hierarchical later (one way)
is_privatebooleantrue (default): visible to you and to whoever you share it with. false makes it public to every user, which needs the publish privilege

create_folder

Create a folder inside a hierarchical collection. The collection must have is_hierarchical=true. Use parent_id to nest folders within other folders, or omit to create at the root level.

ParameterTypeDescription
collection_id *numberCollection ID (must be a hierarchical collection)
name *stringFolder name
parent_idnumberParent folder ID for nesting. Omit for root-level folder

list_folder

List the contents of a folder or project, folders and projects first (an is_folder item can be listed further by its id). For navigating INSIDE a hierarchical collection — a flat collection, or a hierarchical collection's top level, is listed with search_documents(collection_id). depth: 1 (default) immediate children, N levels, 0 the entire subtree; when depth != 1 each item carries parent_id. filters narrow by type_id, name, labels or metadata; limit 0 (default) is unbounded.

ParameterTypeDescription
folder_id *numberFolder or project ID whose contents to list
depthnumberRecursion depth: 1 = immediate children (default), N = up to N levels, 0 = the entire subtree
filtersarrayStructured filters, ANDed with the folder scope (call list_metadata_fields to discover metadata field names)
includearrayExtra fields per item: "labels" (label objects), "metadata" (the metadata map incl. typed fields like type:assignee). Status is always included
include_hiddenbooleanInclude hidden/system documents (default false)
limitnumberMax items; 0 (default) = unbounded. A positive cap (recommended with depth=0 on large trees) sets truncated=true when hit

list_metadata_fields

Metadata fields and their types. Without type_id: the collection-level fields (the filter fields for search_documents). With type_id: the EFFECTIVE schema of that document type in the collection — collection fields merged with the type's own (a Task's assignee, due_date, priority, estimate). When WRITING metadata use each field's `metadata_key`, NOT its display name: type-scoped fields are prefixed (name "assignee" → "type:assignee"); `scope` says which.

ParameterTypeDescription
collection_id *numberCollection ID
type_idnumberDocument type ID (from list_document_types). When given, returns the type's effective fields (collection + doctype) instead of just the collection fields

update_collection

Change a collection's settings: name, description, instructions (replaced whole — read them with get_collection first to edit them), is_private, or is_hierarchical: true to convert a flat collection (one way). Only the settings passed change. Making a collection public (is_private=false) needs the publish privilege; a personal or system collection keeps most settings fixed, and the error names the ones it allows.

ParameterTypeDescription
collection_id *numberCollection ID
descriptionstringNew description
instructionsstringGuidance for AI agents working with this collection, replacing the current text; "" clears it
is_hierarchicalbooleantrue converts a flat collection to hierarchical (folders and projects); it cannot go back
is_privatebooleantrue: visible to you and to whoever you share it with; false: public to every user
namestringNew name

define_metadata_fields

Define a collection's metadata fields — the keys update_metadata and create_document(metadata) accept there — in one call. Each entry of `fields` creates the field when the collection lacks it (`type` required) or changes the type, description or is_auto_extracted it names; a field cannot be renamed — remove it and create the new name. `remove` deletes fields by name. Items succeed or fail on their own; each result says created, updated, removed or the error. is_auto_extracted: true makes the extraction pipeline run an LLM on EVERY document of the collection to fill the field: leave it o…

ParameterTypeDescription
collection_id *numberCollection ID
fieldsarrayFields to create or change
removearrayNames of fields to delete

list_projects

List projects across all collections (most recently modified first) as {count, projects}; truncated: true says more than limit match. A project is a special folder that anchors AI project workflows. Take one in with get_project_brief (brief + counts, sizes the graph read) then get_project_graph; list_folder walks its file tree, set_document_status advances its workflow.

ParameterTypeDescription
limitintegerMax results (default 100; 0 = every project)
querystringFilter projects by name (case-insensitive substring)

create_project

Create a project in a hierarchical collection, scaffolded from a template, in one call. Its own markdown is the BRIEF: unless scaffold=false the template's skeleton — patched with the summary/objective/context/scope/success_criteria seeds — becomes the content, and the anchor documents (AGENTS.md, REFERENCES.md) are seeded as published children; references fills REFERENCES.md and links each source. Templates are the project types (list_project_templates): default "simple" (task-first), "structured" only when dense source material needs grounding first. Scaffolding is best-effort — proble…

ParameterTypeDescription
collection_id *numberCollection ID (must be a hierarchical collection)
name *stringProject name
contextstringSeed content for the brief's Context & background section
methodologystringOverride of the template's like-named methodology (list_node_kinds lists them). Usually omit; changeable later via update_metadata (type:methodology)
objectivestringSeed content for the brief's Objective section (what the project is trying to achieve)
parent_idnumberParent folder/project ID for nesting. Omit for collection root
referencesarraySource documents to seed into REFERENCES.md — each is listed there and linked with a reference relationship. Use this instead of linking every new node back to the source
scaffoldbooleanWhen true (default), write the template's brief skeleton into the project document and seed its anchor documents. Set false for a bare project container
scopestringSeed content for the brief's Scope section — in/out of scope, as markdown (e.g. bullets under **In scope** / **Out of scope**)
success_criteriastringSeed content for the brief's Success criteria section
summarystringThe brief's opening paragraph (no heading): what the project is and what "done" looks like. The dashboard shows only these lines until expanded, so always pass it
target_datestringThe project-level deadline (ISO date), stamped on the target_date metadata field. Task-level scheduling lives on the tasks
templatestringWhich project template to scaffold from (the project type). Default "simple" — task-first; "structured" for a source-grounded project. Use list_project_templates to see the available kinds. Ignored…

get_project_brief

First project intake: the visible markdown brief plus document counters, to size the get_project_graph read. Counts cover every readable document in non-deleted branches (root, containers, hidden anchors, archived, unclassified); Tasks and Trackers are counted separately, by_kind/by_type include both. Returns source/version, truncation and next_offset (code points); possibly_depth_limited means counts may be lower bounds. No bodies, no edges. latest_document_modified_at is NOT a graph-change watermark: never pass it as get_project_graph.since, which wants the newest modified_at already seen fr…

ParameterTypeDescription
project_id *integerThe Project document id. A Workstream id works too: its graph is the work it follows.
max_charsintegerMaximum brief characters returned; counters are unaffected.
offsetintegerUnicode codepoint offset; use next_offset to continue the brief.

get_project_graph

Read a page of the project graph: the subtree's documents as nodes (kind and lifecycle state resolved) plus typed, directional edges. Default limit 500, max 1000: follow next_after with identical filters until null (edges may target nodes on other pages; truncated stays true on the last page when after > 0). Each node is compact — id, name, kind, state (display label), status (the step name set_document_status takes), group, type_name, parent_id, depth, modified_at, labels, metadata, locker, outgoing edges; empty fields omitted, metadata.snippet only with snippet:true. `fields` keeps only wh…

ParameterTypeDescription
project_id *numberThe Project's document id (the project root), from list_projects or create_project. A Workstream id works too: its graph is the work it follows
afterintegerContinue with next_after and identical filters
archivedbooleanKeep only archived (true) or unarchived (false) nodes
comment_countsbooleanAdd comment_count to every node, so you can skip list_comments on the nodes that have none
edgesbooleanInclude edges (default true). false = node list only; with since, only the changed nodes are returned (the cheapest "what changed" read)
fieldsarraySelect descriptive fields; id, requested edges and comment_count always survive. Use edges:false to omit topology. An empty list keeps only these mandatory fields
kindarrayKeep only these node kinds, e.g. ["task"]
labelarrayKeep only nodes carrying one of these label paths; a bare group ("work") takes the whole group
limitintegerMaximum nodes per page (default 500)
sincestringDelta watermark (ISO-8601): the newest modified_at already seen — changed nodes come in full, the rest skeletal (id, name, kind, state, parent_id, edges)
snippetbooleanInclude metadata.snippet (default false)
statearrayKeep only these lifecycle states, by step name or display label

apply_project

Create, revise and re-wire project nodes and edges in one batch — the write counterpart of get_project_graph. CREATING: each node names a kind (the backend resolves doctype + kind label and starts its workflow); edges are the (src, rel, dst) triples the graph shows and may reference nodes created in the same call by `ref`; created nodes are born published. MAINTAINING: nodes_update patches (re-kind, metadata, labels, rename, move, archive), edges_update renames/re-annotates, edges_delete removes — deletions apply before creations, so moving a task between milestones is one call. LABELS: `l…

ParameterTypeDescription
project_id *numberThe Project's document id (the project root). A Workstream id works too: its graph is the work it follows; there a new node must name parent_id (the project or folder where it lives) and is followed i…
edgesarrayEdges to create among new nodes (by ref) and/or existing documents (by id)
edges_deletearrayEdges to remove
edges_updatearrayEdges whose name/extra to patch (type/src/dst are immutable — rewiring is edges_delete + edges)
nodesarrayThe nodes to create, in one batch
nodes_updatearrayExisting nodes to patch: re-kind, set metadata/labels, rename, move, archive or restore
on_errorstring"continue" (default) attempts every item; "abort" stops at the first failure
verbositystring"ids" or "full" (see description). Default: "ids" above 10 items, else "full"

list_node_kinds

The project ontology: the kinds apply_project accepts (group, description, lifecycle policy), the configured methodologies with their guidance, and contexts. SVG icons only with include_icons.

ParameterTypeDescription
include_iconsbooleanInclude each kind's SVG icon (default false — the icons are most of the payload and mean nothing to an agent)

list_project_templates

The project templates create_project can scaffold from — each a brief skeleton + anchor documents, stamping its like-named methodology on the project.

update_plan

Create or change an agent plan — for agents; people keep projects and tasks. A plan is a todo list that lasts: steps can contain steps, come `after` other steps, and go to another agent with `executor`. Change only the steps under the node you hold. Never give a status to a step that contains steps, except cancelled. Before you stop, leave every step you started completed (result as note), blocked or cancelled; a waiting step stays pending. Worth it when steps outlive a turn or order matters. Required before a second agent starts: one step per agent, with its executor. Without node, goal cre…

ParameterTypeDescription
closestringComplete or cancel the plan (only the holder of the plan)
goalstringCreates a plan: its goal, constraints and done-criterion, as markdown (first line = name)
nodeintegerThe plan or the step you hold. Omit only to create a plan
stepsarrayThe steps to add or change

get_plan

Read an agent plan, or the part of it you hold: the open steps of node's subtree as a tree, with ids. The status of a step that contains steps is computed from them (never a stale stored one); a step handed to another agent shows as one line with its executor and last activity. Read on a step, it starts with the step's brief, your starting context. Then: ready (pending, with every predecessor of it and of the steps containing it done), running, paused (nobody at work on it: hand it on again, take it back or cancel it), blocked with its question and the update_plan {id, answer} that answers it…

ParameterTypeDescription
node *integerThe plan, or a step in it

search_documents

Finds the documents that match a query, by keywords and by meaning, and filters them by fields: in one collection, or with collection_id=0 in every collection the caller can read (filters on system fields only). Use it to learn WHICH documents are relevant; use find to read the matching passages. The query reads the text, the name and the short metadata values of a document. Structured filters need field names from list_metadata_fields; cursor pages. Each query result reports WHERE it matched: by default the distinct sections that hold its matches (breadcrumb + durable #s{id}, usable as read_d…

ParameterTypeDescription
collection_id *numberCollection ID, or 0 for every collection the caller can read: the query and the system-field filters work there, a custom metadata field does not
cursorstringThe next_cursor of the previous call; it keeps that call's arguments
depthnumberWith `under`, limit recursion to N levels deep. 0 or omit = the entire subtree
detailstringHow much match evidence per result. "compact": the distinct sections the matches fell in, plus `matches`. "passages": every matching passage with its own from/to span — several times larger, only wo…
filtersarrayStructured filters (ANDed together)
includearrayExtra fields per document
limitnumberMax results; 0 for the largest page
querystringFree text. Unquoted words rank the results, by keywords and by meaning, so a result need not hold any of them. A "quoted phrase" (“…” and «…» also work), or a whole query in single quotes, i…
sortobject
undernumberFolder/project ID — restrict to that subtree (hierarchical collections only)

find

Keyword search in one collection, or with collection_id=0 in every collection the caller can read, that returns the matching passages with their text: the documents that match, best first, the top ones with their best passages and the enclosing section (breadcrumb, span, durable uri). It matches by keywords only: use search_documents for a question or a topic whose wording may differ from the text. The query reads the text, the name and the short metadata values of a document. A result that matched in its passages reports `matches`, the number of passages the search found for it (at most 10);…

ParameterTypeDescription
collection_id *numberCollection ID, or 0 for every collection the caller can read
query *stringWords likely to appear in the text, separated by spaces: they rank the results, and without a phrase every result holds at least one of them. A "quoted phrase" (“…” and «…» also work), or a…
depthnumberWith `under`, limit recursion to N levels deep. 0 or omit = the entire subtree
detailstring"passages": the top 5 results carry their 2 best passages each. "full": every result carries all the passages counted in its `matches` (one request per result: bound it with `limit`). "compact": the r…
limitnumberMax results
undernumberFolder/project ID — restrict to that subtree (hierarchical collections only)

find_similar

Documents in the same collection that resemble a given one, most similar first — takes a document instead of a query, so it reaches near-duplicates, earlier/later versions and same-subject neighbours in other words, which keyword search cannot. The tail is autocut where similarity drops, generously on a single-subject corpus: treat the ORDER as the signal, not list membership. Scores are not comparable across source documents. To group a collection, call per document and read each list on its own: a pair that ranks each other highly (reciprocal rank) is a weak secondary signal at most, not w…

ParameterTypeDescription
document_id *numberThe document whose neighbours you want
autocutnumberHow eagerly to cut the tail at similarity drops: lower is stricter, 0 keeps everything up to limit (backend default 4)
depthnumberWith `under`, limit recursion to N levels deep. 0 or omit = the entire subtree
limitnumberMax neighbours
undernumberFolder/project ID — restrict to that subtree (hierarchical collections only)

get_document_info

Get metadata for a document, or for MANY in one call (document_ids, max 200 — one list read, every id answered in the order asked; a missing or unreadable one is an {error} entry, so an absence never needs a second call). Returns label_ids (the raw label id array); use include to request extra fields — status_object (the current workflow step) is null unless included. The batch form serves each document's compact list shape (published version, parent_id, status_id, label_ids, metadata, plus what include adds): where it lives, whether it is open, who holds it. publish_run (system_metadata,…

ParameterTypeDescription
document_idnumberDocument ID. Omit when passing document_ids
document_idsarrayRead many documents at once (max 200). Every id is answered, in the order asked
includearrayExtra fields: labels (label objects — id, path, name, color), relationships, status_object (current workflow step), read/write/deny principals. labels_objects is a deprecated alias for labels

read_document

Read a document's native text: the whole document, a [from, from+length) code-point range, or one section (section_id, resolved server-side to its CURRENT span; a gone section lands on its absorbing/parent section with a warning; a stale stored span is relocated by its heading line, or the whole document is served with a warning — never the stale span). Output is bounded by max_chars: two blocks, the text then one JSON line {stream, version, from, to, total_chars, truncated, next, etag, content_revision, warnings} — when truncated is true call `next` verbatim, never treat a truncated read…

ParameterTypeDescription
document_id *integerDocument ID
changesA Word file with tracked changes: "accepted" (default) reads its text with them, "rejected" the text before them. Office files only
fromStart offset (0-based, code points); omit to read from the beginning
lengthCode points to read from the start; omit to read to the end (still capped by max_chars)
max_charsOutput budget in characters (default 20000, maximum 100000); a longer selection is truncated and next continues it
section_idRead exactly this section (durable id — the number after #s in a section uri, or from get_document_toc). Mutually exclusive with from/length and version
versionSpecific version number. Mutually exclusive with section_id

read_documents

Read the native text of MANY documents in one call — the batch form of read_document for a bulk intake (every card of a project, a folder of notes): document_ids, at most 200, duplicates collapsed. Or related_to with rel: the documents linked to one document, such as the tasks of a tracker (rel "tracks") or of a milestone ("plans"); each entry then also carries its type and status. max_chars (default 20,000, maximum 100,000) bounds EACH document, from its start. One JSON entry per document, in the order asked: {document_id, name, stream, version, content, from, to, total_chars, truncated, ne…

ParameterTypeDescription
document_idsDocuments to read (max 200), answered in this order
max_charsOutput budget PER DOCUMENT in characters (default 20000, maximum 100000); a longer document is cut at its head and its next continues it
relWith related_to: the link seen from related_to, the `rel` of list_relationships — "tracks", "plans", "dependsOn", "referencedBy", …
related_toInstead of document_ids: read the documents linked to this one through rel, in id order

get_document_passages

Extracted passages in document order — the only text of a PDF or an image, a passage index for markdown and office files (read_document reads an office file whole). limit counts PASSAGES; query keeps only the matching passages, still in document order and not ranked (find ranks documents across a collection); page restricts to one source page label (a workbook's sheet position); seq_num reads the exact passage a find result cited. section_id reads ONE SECTION of a binary — a PDF whose embedded outline gave it sections, or a workbook, one section per sheet (get_document_toc reports frame "e…

ParameterTypeDescription
document_id *integerDocument ID
cursornull | stringThe cursor of the previous call's `next`; it keeps that call's arguments
limitMax passages per call (default 10)
pageRestrict to one source page label: a PDF's page, a workbook's sheet position, e.g. "3"
queryKeep only the passages that hold any of these words or, when the query has quoted phrases, one of the phrases (word for word, as in find). For a pattern or exact characters use locate_regex
section_idRead exactly this section of a binary document (durable id — the number after #s in a section uri, or from get_document_toc). Mutually exclusive with page and seq_num; a native section is refused wi…
seq_numRead one exact passage by its sequence number (as cited by find)

get_document_history

Get the version history of a document.

ParameterTypeDescription
document_id *numberDocument ID

diff_versions

Compare two versions of a document and return a unified diff. Use get_document_history to discover available version numbers. Omit from_version to diff against an empty document (i.e. see everything added in to_version).

ParameterTypeDescription
document_id *numberDocument ID
from_versionnumberBase version number (default: version before to_version)
to_versionnumberTarget version number (default: current version)

list_document_types

List available document types that can be created — the complete list, never a page. Call this before create_document to discover valid types. A type's `instructions` (own or inherited from its parent type) say how its documents are written — what the body must and must not contain: FOLLOW them when you create or edit a document of that type. `convertible_to` lists the mime types a document of the type can be turned into with convert_document. A format missing from THIS list is not unavailable: the list holds the types you can author, and DOCX, for one, is a type documents are converted in…

create_document

Create a document with content, published and unlocked (unlock:false keeps the lock). `type` (name or id from list_document_types) is REQUIRED for the semantic markdown types (Task, Decision, Note, …), which all share ".md"; with it the name needs no extension, and one present must be accepted by the type. Without type the backend picks the type owning the name's extension (no extension → ".md" → Markdown). The type cannot be changed afterwards. Folders and projects are create_folder / create_project (rejected here). `metadata` sets typed fields, validated against the type's effective sc…

ParameterTypeDescription
collection_id *numberCollection ID
content *stringMarkdown content — one paragraph per line (see the guide's "Writing markdown")
name *stringDocument name
metadataobjectMetadata field values to set at creation. Keys are each field's `metadata_key` from list_metadata_fields(collection_id, type_id); bare type-field names are auto-prefixed to their `type:` key (`assigne…
parent_idnumberParent folder ID for hierarchical collections. Omit for root-level or flat collections
temporarybooleanMake it a temporary scratch document (default false): hidden, and deleted by the server once nobody reads or writes it for a while — each read or write renews it, up to a ceiling. It disappears unle…
typenumber | stringDocument type: name (e.g. "Note", case-insensitive) or numeric ID from list_document_types
unlockbooleanUnlock (= publish) after creation, default true. false keeps the lock for immediate follow-up edits

promote_document

Make a temporary document (created with temporary: true) permanent: it stops expiring, and its type's normal publish chain runs once. The id, the links and the comments stay. It stays hidden unless show is true. Refused for a permanent document, and for a temporary one never published (created with unlock:false and not yet unlocked).

ParameterTypeDescription
document_id *numberThe temporary document to keep
shownull | booleanAlso make it visible (default false: it stays hidden)

write_document

Write markdown to an existing document: the whole content, or from a code-point position onward — `from` REPLACES everything from that position to the end (to append, pass the document's length). Pass the etag your read_document returned: the write lands only on the content you read, and a refusal (412) means it changed since — re-read and redo the change, never resend. Locks if needed, commits, leaves the document locked; the result carries the etag a next write names. Generated PDF types write to the draft stream. For a change inside existing content prefer edit_document. Every mention o…

ParameterTypeDescription
content *stringMarkdown content to write — one paragraph per line (see the guide's "Writing markdown")
document_id *numberDocument ID
etagstringThe etag of the content you read (read_document; a write's result). Omit only when the read returned none: the write then creates the stream
fromnumberCharacter offset to start writing from (code points). Replaces everything from this position

edit_document

Replace text in a document, three forms. TEXT form: old_text → new_text, exactly one match required (section_id or search_from narrows the search; replace_all replaces every match). RANGE form (old_text OMITTED): when you already hold an exact span, pass from/to + expect_revision copied from the locate_regex result — never re-type the span as old_text (one mistyped character fails the edit); a stale expect_revision rejects the edit instead of splicing at shifted offsets; from == to inserts. SECTION form (old_text omitted, section_id alone): replaces the WHOLE section, its span resolved liv…

ParameterTypeDescription
document_id *numberDocument ID
new_text *stringReplacement text — one paragraph per line; a newline inside a paragraph becomes a hard break (see the guide's "Writing markdown")
expect_revisionnumberThe content_revision the from/to offsets were derived from (returned by locate_regex). Required by the range form; validated whenever present — a stale value rejects the edit instead of splicing at…
fromnumberRange form only (old_text omitted): start of the span to replace (Unicode code points — copy from a locate_regex match). from == to inserts at that position
old_textstringExact text to find. OMIT it for the range form (from/to + expect_revision) or the section form (section_id alone)
replace_allbooleanReplace all occurrences instead of requiring exactly one match
search_fromnumberCharacter offset to start searching from (0-based, code points). Matches before this position are ignored
section_idnumberWith old_text: scope the search to this section's current span. WITHOUT old_text: replace the whole section with new_text. Durable id (the number after #s in a section uri, or from get_document_toc),…
tonumberRange form only (old_text omitted): exclusive end of the span to replace (code points — copy from a locate_regex match)

replace_in_document

Bulk regex find/replace across a document — the sed/awk-style tool. Each rule: `pattern` (JS regex) + `replacement` with $1/$<name> captures and COMPUTED `${expr}` values, where a capture resolves to its NUMERIC value (pattern "§(?<n>\\d+)" + replacement "§${n+3}" shifts every section number by 3 in ONE rule); an optional `where` guard (boolean, same language) skips matches. Rules apply in one cascade-safe left-to-right pass (single_pass). ^ and $ are string-anchored without the "m" flag; case-sensitive without "i". Preview-first (diff + per-rule counts); on commit locks if needed, splices…

ParameterTypeDescription
document_id *numberDocument ID
edits *arrayOrdered list of find/replace rules
previewbooleanDry run: return the unified diff + per-rule counts WITHOUT writing. Call again with preview:false to commit
search_fromnumberRestrict edits to offsets >= this (document-absolute, code points)
search_tonumberRestrict edits to offsets < this (document-absolute, code points)
single_passbooleanApply all rules in ONE left-to-right scan, first matching rule wins (cascade-safe). false = run each rule over the whole doc in turn (rules can cascade)

renumber_document

Re-sequence a document's already-numbered headings with Word-style multilevel numbers (1, 1.1, 1.1.1) from nesting + position, and remap the inline §refs using the same scheme so they stop drifting. By default only headings ALREADY carrying a number are re-sequenced — the title and preamble headings ("## Related") stay clean. Do NOT use it to ADD numbers to a clean document: numbering is moving to render-time CSS, and baking numbers in fights that (skip_unnumbered:false is a deliberate opt-out). Preview-first (heading map + diff); on commit locks if needed and leaves the document locked.

ParameterTypeDescription
document_id *numberDocument ID
max_depthnumberHow many heading levels to number, counting from start_level. Default: all
previewbooleanDry run: return the heading map + diff WITHOUT writing. Call again with preview:false to commit
ref_prefixstringLiteral marker before a reference number (e.g. "§" matches §3.2)
remap_refsbooleanAlso rewrite inline cross-references using the old→new number map
separatorstringJoiner between level numbers (1.1.1)
skip_refsarrayRef tokens to leave UNTOUCHED (cross-document refs spotted in the preview diff), e.g. ["§0·ter", "§9·bis"]; a bare "§0" skips every §0 ref
skip_unnumberedbooleanRe-sequence only headings that already carry a number; unnumbered headings (title, "## Related") are left untouched and don't advance counters. Set false to number EVERY heading positionally
start_levelnumberTop heading level to number, e.g. 2 = start at ##. Default: the shallowest heading present

mark_headings

Stamp status markers (✅ 🚧 ⬜ ⏸️) on headings addressed by NUMBER ("4.2") or exact TITLE; "" clears one; no marks = read back the heading map. IDEMPOTENT: an existing marker is REPLACED, never stacked — a regex character class cannot recognise these markers (⏸️ is two code points, 🚧 a surrogate pair), which is why replace_in_document silently appends a second one. Markers sit inside the title after any heading number, so renumber_document still parses it. Table rows, fenced code and headings outside `levels` are never touched; an unmatched key is reported, an ambiguous one wr…

ParameterTypeDescription
document_id *numberDocument ID
levelsarrayOnly headings at these levels (1-6) are addressable, e.g. [2,3]. Default: all
marksobjectMap of heading key → marker, e.g. {"4.2": "✅", "5": "⬜", "Open questions": ""}. Key = the heading's number, or its exact title (marker stripped). "" clears the marker. Omit entirely to read the…
positionstring"suffix" = "## 4 Milestones ✅", "prefix" = "## 4 ✅ Milestones" (both keep the number first). Flipping it on a marked doc moves the marker
previewbooleanDry run: return the heading map + diff WITHOUT writing. Call again with preview:false to commit
separatorstringJoiner between level numbers in an existing heading number (1.1.1) — must match renumber_document's
vocabularyarrayEvery string treated as a marker — used to strip the OLD marker before writing the new one. Default: ✅ 🚧 ⬜ ⏸️. A symbol not listed here is ordinary title text and is left alone (so "## 3…

unlock_document

Unlock a document after editing. Call this when done writing to release the lock. Unlocking PUBLISHES: it mints the new version and re-extracts the section tree, so a stale TOC (spans_fresh: false) is refreshed by this call — there is no other refresh. It publishes only a lock this server took whose draft holds only writes made here: a draft that is a person's (their editor's lock), or that took a write made elsewhere, is refused — the person publishes it. After a refused write here, it publishes once a write lands again.

ParameterTypeDescription
document_id *numberDocument ID

read_stream

Read a named stream from a document as text. System streams are "draft" (Markdown), "data" (JSON), "style" (CSS: the theme binding and the document's own rules) and "theme" (CSS: the private slot overlay); an application stream carries a typed extension (props.json, notes.md). A stream whose type is not textual errors instead of dumping bytes. The text comes with a JSON line {etag, content_revision}: write_stream over this content names the etag.

ParameterTypeDescription
document_id *numberDocument ID
stream_name *stringStream name: "draft", "data", "style", "theme", or an application stream with a typed extension such as props.json
versionnumberSpecific version number

write_stream

Write the whole content of a named stream on a document; the write commits by itself. Over an existing stream pass the etag your read_stream returned (a refusal means it changed: re-read, never resend); without etag the write only creates a stream that does not exist yet. Writing "main", or "draft" of a type that generates from Markdown, locks the document if needed and leaves it locked; another stream of an unlocked document is written without a lock. The name declares the type: a system stream ("draft", "data", "style", "theme") or an application stream with a typed extension (props.json, no…

ParameterTypeDescription
content *stringContent to write
document_id *numberDocument ID
stream_name *stringStream name: "draft", "data", "style", "theme", or an application stream with a typed extension such as props.json
etagstringThe etag of the stream as you read it (read_stream); omit only to create the stream

update_metadata

Set metadata field values on a document — collection fields plus the document type's own (a Task's assignee, due_date, priority; list_metadata_fields with the type_id shows them). Keys are each field's metadata_key; bare type-field names are auto-prefixed to `type:`. Partial merge: only the given fields change; null removes one. `expected` names, for every key you change, the value you read (get_document_info; null if it had none): a key someone changed since is refused with its current value — read it again before deciding.

ParameterTypeDescription
document_id *numberDocument ID
expected *objectFor every key of metadata, the value you read for it, null if it had none
metadata *objectKey-value pairs to set. Keys are each field's `metadata_key` from list_metadata_fields; bare type-field names are auto-prefixed to their `type:` key by the backend. Set value to null to remove a field…

rename_document

Rename a document by changing its `name` field. File-named documents keep their extension ("Report Q3.pdf"); typed documents keep plain titles (see the guide's "Creating documents"). Does not change collection, content, or version. To move across collections or folders, use move_document.

ParameterTypeDescription
document_id *numberDocument ID
name *stringNew document name (with the extension only for file-named documents, e.g. "Annual Report.pdf").

move_document

Move a document to another folder, project or collection: parent_id for a container (folder or project root — the document lands inside it), collection_id alone for that collection's root, both for a folder elsewhere. Content, versions, comments, labels, workflow status and relationships travel with it; edges to nodes left behind become cross-project links (visible via list_relationships, in neither graph). This is how a node moves between projects — apply_project cannot pull one in or push one out. Folders and projects cannot move across collections. 423 if checked out by someone else.

ParameterTypeDescription
document_id *numberDocument ID to move
collection_idnumberDestination collection ID — alone, the document lands at this collection's root. Not needed with parent_id: the container carries its own collection.
parent_idnumberDestination container: a folder or project root document ID (any collection). Omit to land at the collection root.

delete_document

Move a document to the bin: a folder or project goes with its whole subtree, in one gesture a person restores as one. It never deletes for good — the bin keeps them and only a person empties it; there is no purge, and a collection synced in write mode, where every delete purges, refuses an agent. Answers with the document's name and `documents`: how many went, the document included, counted just before the delete. A descendant locked by another person (423) or one you cannot write (403) refuses the whole gesture, and nothing moves.

ParameterTypeDescription
document_id *numberDocument to move to the bin, with everything under it

convert_document

Convert a document into another format, as a NEW document beside it: Word (docx), PowerPoint (pptx), PDF, markdown. The new document lands in the source's collection and folder, named after it with the new extension; the source is untouched — a conversion never retypes a document in place, so "convert this note to Word" means a .docx is born next to the note. Say so when you report the result. `convertible_to` on the source type's entry in list_document_types says which targets it reaches. Markdown is reached only from a Word file and the import loses complex tables and list nesting: run it…

ParameterTypeDescription
document_id *numberDocument ID to convert
authorstringWith a base: the author Word shows on each change; default the full name of its modifier.
base_documentnumberInstead of base_version: the id of a .docx converted earlier from this document (the file sent).
base_versionintegerWord with tracked changes: the older version. The .docx holds `version` and marks every change since this one. Markdown sources, format docx.
collection_idnumberCollection for the new document. Defaults to the source's, which is almost always what you want.
formatstringFormat to produce. Give this or `type` (or both, naming the same format).
namestringName for the new document. Defaults to the source's name with the new extension; a clash is renamed server-side, so this is rarely worth passing.
parent_idnumberFolder for the new document. Defaults to the source's folder — but only when it stays in the source's collection; sent to another collection without this it lands at that collection's root.
typestring | numberThe new document's type, as a name or id from list_document_types. Use it instead of `format` to pick WHICH markdown type a conversion to markdown lands in (Note, Task, …).
versionintegerWith a base: the newer version; default the published one.
word_templatestringFormat docx only: the Word template whose styles the file takes. Omit it, and the file keeps the look of the source: this is the default. Give "classic" only when the user asks for a plain or classic…

list_labels

List labels — the complete list, never a page — to find ids for update_labels or check existence before create_label. Empty fields are left out; the document_deny_* ACL lists only with include_deny.

ParameterTypeDescription
include_denybooleanKeep the document_deny_read / document_deny_write lists (the principal ids a label denies) on each label; default false
querystringFilter labels by name

update_labels

Add or remove labels on a document. Use list_labels to discover available label IDs. Use get_document_info with include=["labels"] to see current labels.

ParameterTypeDescription
document_id *numberDocument ID
addarrayLabel IDs to add
removearrayLabel IDs to remove

locate_regex

Regex matches in a document's markdown: from/to (code points), a snippet per match, and content_revision. TO REPLACE A MATCH pass its from/to plus content_revision (as expect_revision) to edit_document with old_text OMITTED — nothing re-typed, a stale range rejected. For targets inside prose, ::: blocks, table cells; for section-level targets get_document_toc already has the heading text and span (fall back to "^#+ .*$" here only when the TOC is empty). Default flags "im" (case-insensitive, ^/$ per line). Generated PDF types are searched in their markdown draft. An office file is searched in…

ParameterTypeDescription
document_id *numberDocument ID
pattern *stringJavaScript regex pattern
changesAn office file: search its text with its tracked changes "accepted" (default) or "rejected"
context_charsnumberAlso return a context field per match: up to this many characters of surrounding document text on each side (max 500)
flagsstringRegex flags (default 'im': case-insensitive + multiline). Pass '' for case-sensitive, add 's' to let . cross newlines (dotAll). 'g' is always applied; do not pass it
search_fromnumberCharacter offset to start searching from (0-based, code points). Matches before this position are skipped

get_document_toc

Document outline: the live section tree — durable section ids (deep-linkable as #s{id}), heading, level, from/to spans, occurrence (> 1 = duplicate heading). No content is read; the ids feed read_document, edit_document, add_comment, add_bookmark, and are the id source for cross-reference links (/documents/{id}#s{section_id} — see the guide's "Relationships and cross-references"). `frame` says what the spans count into: "native" (the markdown) or "extracted" — a PDF whose embedded outline gave it sections, each with its `page` (1-based) and `boundary: "page"` when its heading was not loc…

ParameterTypeDescription
document_id *numberDocument ID

upload_document

Upload a local file — as a NEW document, or as the next version of an existing one. The bytes go from disk to the server, never through the conversation: use it for any binary or large file. New: collection_id, or parent_id alone — a folder or project in any collection, which the document is created inside (no move needed). name defaults to the file name; keep the extension, it picks the type unless `type` names one. document_id instead writes the file as that document's new content: same id, links and history; name, type and place stay (rename_document, move_document change them). With do…

ParameterTypeDescription
file_path *stringAbsolute path to the local file
collection_idnull | numberCollection to create the document in. Not needed with parent_id (the container carries its collection), nor with document_id
document_idnull | numberExisting document to write the file into as its next version, instead of creating one
etagnull | stringWith document_id: the etag of the content the file replaces, from get_document_info or read_document; omit only when there is none
namenull | stringName of the new document, extension included (e.g. "report.pdf"). Defaults to the file name
parent_idnull | numberFolder or project to create the document inside, in any collection. Omit for the collection root
temporarynull | booleanNew document only. Make it a temporary scratch document (default false): hidden, and deleted by the server once nobody reads or writes it for a while — each read or write renews it, up to a ceiling.…
typenull | number | stringType of the new document: name (case-insensitive) or numeric ID from list_document_types. If omitted, it is inferred from the name's extension
unlocknull | booleanPublish when done (default true). false keeps the lock: the content waits as a draft until unlock_document

create_label

Create a label. A dot path creates missing parents as unassignable ("legal.civile"); returns the labels created; errors if the leaf exists (list_labels first). Write a meaningful `description`: it is embedded and used at ingestion to auto-extract the label. EXCLUSIVE AXIS: every attribute lands on the LEAF, never on an auto-created parent — for mutually exclusive children (kind.*), create the parent FIRST with is_assignable:false and max_child_card:1, then the children. update_label repairs an existing group.

ParameterTypeDescription
path *stringFull dot-separated path of the label. Parents are auto-created as unassignable. Example: "legal.civile"
colorstringOptional hex color, e.g. "#3b82f6". Applied to the leaf label.
descriptionstringThe signal embedded for auto-extraction at ingestion: a precise, content-oriented sentence saying which documents should receive this label. Also shown in tooltips. Applied to the leaf
is_assignablebooleanWhether the leaf label can be assigned to documents (default true). Auto-created parents are always unassignable.
is_auto_extractedbooleanWhether the label is eligible for automatic extraction from document content (default false).
max_child_cardintegerHow many direct children of THIS label one document may carry; 1 makes the group exclusive (a second child is rejected). Applied to the leaf — set it on the parent of an axis, not on its children
parent_idnumberOptional ID of an existing parent label. When set, `path` is appended under that parent.

update_label

Patch a label: rename, recolour, rewrite the description, or change its behaviour — the only way to repair a label after creation (create_label errors on an existing path and puts every attribute on the leaf, so an auto-created parent is fixed only here: e.g. max_child_card:1 to make an existing group exclusive). `name` renames IN PLACE, descendants included — the path is rebuilt, so anything holding the old path by string goes stale (ids do not). Omitted fields are left alone.

ParameterTypeDescription
label_id *numberThe label id to patch, from list_labels
colorstringNew hex colour, e.g. "#3b82f6".
descriptionstringNew description. This is the text embedded for auto-extraction, so make it content-oriented — what kind of document should receive this label.
is_assignablebooleanWhether the label can be put on a document. A namespace parent should be false.
is_auto_extractedbooleanWhether ingestion may apply this label on its own.
max_child_cardintegerHow many direct children of this label one document may carry. 1 makes the group exclusive.
namestringNew final path segment — renames the label in place, carrying its descendants with it. Not the full path: to rename "work.debt" to "work.chore", pass "chore".

list_comments

List comments on one document, or on MANY in one call (document_ids, max 200 — every id is answered, so an empty list is a fact; get_project_graph comment_counts says which nodes have any). Filter by source and resolved. Comments routinely correct the document they sit on: read them before acting on a body. Two system-maintained stamps per comment: section_id (the enclosing section) and location_state — "exact": location.from/to sit on the quoted text; "approximate": the anchor was re-homed after edits — treat the offsets as a neighbourhood and re-locate the quote before acting on them.

ParameterTypeDescription
cursorstringThe next_cursor of the previous call, which keeps its arguments. Single-document form only
document_idnumberDocument ID. Omit when passing document_ids
document_idsarrayRead many documents at once (max 200). Every id is answered for, including those with no comments
limitnumberMax results (default 100, 0 = every comment). Single-document form only
resolvedbooleanFilter by resolved status
sourcestringFilter by comment source

add_comment

Add a comment — one, or MANY in one call. Modes: (1) whole_document=true — no anchor, pinned at the top, for remarks about the document as a whole; (2) section_id — the section's current span, resolved server-side (a gone section refuses); (3) from/to offsets (from locate_regex); (4) search_text — find and anchor in one call, must match exactly once (search_from narrows). Replies: parent_id and no anchor, to a TOP-LEVEL comment only (two levels deep). BATCH: comments: [{document_id, content, …}] — each item carries its own mode and anchor, items succeed or fail on their own, result…

ParameterTypeDescription
commentsarrayAdd many comments at once (max 200), each with its own mode: whole_document, section_id, from/to, search_text, or parent_id for a reply
contentstringComment text. @name mentions notify that user (exact case-sensitive principal name)
document_idnumberDocument ID. Omit when passing comments
fromnumberStart offset (code points). Required unless search_text, section_id, whole_document or parent_id is given
parent_idnumberParent comment ID for replies. Replies need no anchor of their own
search_fromnumberCharacter offset (code points) to start searching from when using search_text. Narrows scope to avoid ambiguous matches
search_textstringText to find in the document and anchor the comment to. Must match exactly once (or use search_from to disambiguate)
section_idnumberAnchor to this entire section (durable id — the number after #s in a section uri, or from get_document_toc); on a section of a binary (frame "extracted") the comment lands on the section's page (pag…
tonumberEnd offset (code points), required with from
whole_documentbooleanComment on the document as a whole — no anchor. Mutually exclusive with from/to/search_text/section_id

resolve_comment

Toggle the resolved status of a comment.

ParameterTypeDescription
comment_id *numberComment ID
document_id *numberDocument ID
resolved *booleanSet resolved status

delete_comment

Delete a comment from a document.

ParameterTypeDescription
comment_id *numberComment ID
document_id *numberDocument ID

list_bookmarks

The user's private bookmarks on documents and sections. Section bookmarks carry a durable target_uri (collhub://documents/{id}#s{section_id}); section_gone: true = the section was edited away, inaccessible: true = the target is no longer readable.

ParameterTypeDescription
cursorstringThe next_cursor of a previous response (pages of 50)

add_bookmark

Bookmark a document or a section for the user (their private pointer — visible in their bookmarks panel). Pass document_id for a whole-document bookmark, or section_id (durable id from get_document_toc or a passage's #s uri) for one section — section bookmarks keep resolving after the document is edited. Bookmarking the same target twice errors.

ParameterTypeDescription
document_idnumberBookmark this whole document. Mutually exclusive with section_id
notestringOptional short note stored with the bookmark
section_idnumberBookmark this section (durable id — the number after #s in a section uri, or section_id from get_document_toc). Mutually exclusive with document_id

remove_bookmark

Remove one of the user's bookmarks (id from list_bookmarks).

ParameterTypeDescription
bookmark_id *numberBookmark ID

list_relationship_types

List available relationship types — the complete list, never a page. Call this before create_relationship to discover valid types and their directional labels.

ParameterTypeDescription
querystringSearch query to filter types by name

list_relationships

A document's relationships, outgoing and incoming, with the related document and the directional label. Link-derived edges carry origin "xref" (no origin = made by hand) and SECTION granularity: from_section (the section holding the link) and to_section (the one addressed), each {id, document_id, heading, uri} — `gone` when the body still cites a removed section, `unknown` when its tree was unreadable or beyond the 25-document cap. Link-derived edges are computed at publish, a beat AFTER unlock: an empty result right after a write is timing, not absence — re-read. section_id keeps only edg…

ParameterTypeDescription
document_id *numberDocument ID
section_idnumberKeep only edges with this section on either end (durable id — the number after #s in a section uri, or section_id from get_document_toc)
show_hiddenbooleanAlso return the system edges the UI hides — the `containment`, `content` and `attachment` types (folder membership, a generated file's draft, an attached image). Off by default
typestringFilter by relationship type name

create_relationship

Create a typed relationship from document_id to dst_document_id (type_id from list_relationship_types; for the inverse direction swap the endpoints). NOT for a plain reference a body link already derives — see the guide's "Relationships and cross-references"; reserve it for the semantic types a link cannot encode (implementation, derivation, addressing, …), created even when a link sits beside the mention. `tracking` (src_rel "tracks") goes FROM a Tracker TO each task it follows and drives the tracker's derived status; prerequisites are `dependency` (dependsOn), which derives no status. `f…

ParameterTypeDescription
document_id *numberSource document ID
dst_document_id *numberTarget document ID
type_id *numberRelationship type ID from list_relationship_types
namestringOptional relationship name

delete_relationship

Delete a relationship from a document.

ParameterTypeDescription
document_id *numberSource document ID
relationship_id *numberRelationship ID

list_data_sources

List available data sources. Returns source names and schemas.

query_data_source

Query rows from a data source. Supports PostgREST-style filters, column selection, ordering, and limits. A :::chart / :::table / :::template block binds the same query as a path, `name?select=…&col=op.value&order=…&limit=N`, built from these arguments.

ParameterTypeDescription
name *stringData source name
filtersarrayPostgREST filters (e.g. ["category=eq.electronics", "price=gt.100"])
limitnumberMax rows to return
orderstringOrder clause (e.g. "name.asc" or "price.desc")
selectstringColumns to return, comma-separated (e.g. "name,price"). Supports aliases and aggregates (e.g. "total:amount.sum()")

create_data_source

Create a new data source, all or nothing, from JSON rows (`data`) or from a CSV, TSV or XLSX document (`document_id`, read by the server: never read it yourself to pass its rows). The server infers the columns: whole numbers bigint, decimals numeric, dates date or timestamptz, the rest text; `columns` overrides the type of the columns it names. An `id` column whose values are present and unique becomes the primary key, else a uuid `id` is added. A value that does not fit its column creates nothing, and the error names its row (the 1-based item of `data`, the spreadsheet row). The result lists…

ParameterTypeDescription
name *stringTable name (lowercase, snake_case, e.g. "sales_data")
columnsarrayType overrides, by column name or input header (e.g. [{"name": "zip", "type": "text"}]). The other columns keep the inferred type
dataarrayRows as JSON objects keyed by column header; values are text, numbers, booleans or null. Omit when passing document_id
descriptionstringDescription of the data source
document_idnumberA CSV, TSV or XLSX document to import (its first sheet). Omit when passing data
temporarybooleanMake it a temporary table (default false): hidden from list_data_sources, private and read-only, and dropped by the server once nobody queries it for a while — each query renews it, up to a ceiling.…

insert_records

Insert one or more records into an existing data source.

ParameterTypeDescription
name *stringData source name
records *arrayArray of JSON objects to insert

update_records

Update records in a data source matching the given filters.

ParameterTypeDescription
filters *arrayPostgREST filters to select rows to update (e.g. ["id=eq.abc-123"] or ["status=eq.pending"])
name *stringData source name
values *objectFields to update with new values

delete_records

Delete records from a data source matching the given filters.

ParameterTypeDescription
filters *arrayPostgREST filters to select rows to delete (e.g. ["id=eq.abc-123"] or ["status=eq.archived"])
name *stringData source name

list_threads

List AI chat threads: {threads, next_cursor}, each with id, name, type, status, and timestamps.

ParameterTypeDescription
cursorstringThe next_cursor of the previous call, which keeps its arguments
limitnumberMax results (default 50, 0 = every thread)
offsetnumberRefused: page with cursor
querystringSearch query to filter threads by name

list_thread_messages

Messages in a thread, chronological: role, content, attachments, tool calls. Paged — the result is {thread_id, messages, next}, and `next` is the call for the following page whenever one exists (null when the thread ends here); limit 0 returns the whole thread in one call. Never treat a full page as the end of the thread.

ParameterTypeDescription
cursorstringThe cursor that `next` names, which keeps thread_id and limit
detailstring"compact" (default): attachment content is capped at 500 chars, a trailing … marking the cut. "full": attachment content is never truncated — use when an attachment carries the payload you came fo…
limitnumberMessages per page (default 100, the backend's own page size). 0 lifts the cap and returns the whole thread in one call
offsetnumberRefused: page with cursor
thread_idnumberThread ID. Omit with a cursor

send_message

Send a message to a thread and wait for the turn that answers it (no thread_id = a new "chat" thread). The result names thread_id, message_id, turn_id and the turn's outcome, with the messages of that turn. Past the timeout it is no error: status "running" (its turn goes on), "waiting" (no turn took it yet) or "unknown" (stored, but a later read failed) with the ids — read the answer later with list_thread_messages, never send the message again. Edits follow the thread's edit mode: "auto" applies and publishes them; "manual" writes them into the locked draft and withholds the publish for a h…

ParameterTypeDescription
content *stringMessage content to send
attachmentsarrayAttachments, each {attachment_type, ...}: {attachment_type: "document", id: <document id>} (collection_id optional), {attachment_type: "collection", id}, {attachment_type: "folder", id, collection_id}…
auto_apply_editsbooleantrue = "auto" (edits applied and published), false = "manual" (written into the locked draft, published on human approval). Omitted: a new thread is "auto", an existing one keeps its mode
detailstring"compact" (default): attachment content in the response messages is capped at 500 chars, a trailing … marking the cut. "full": attachment content is never truncated — use when the agent's answer a…
modestringThread mode name (e.g. "balanced", "advanced")
thread_idnumberThread ID. If omitted, a new "chat" thread is created.
timeoutnumberMax seconds to wait (default 120; at most 50 when the request carries no progress token). Past it the result says the turn is still running or the message still waits, with the ids to read it later.
waitbooleanWait for the turn that answers the message (default true). false returns at once with the thread and message ids.

list_workflows

List all workflow definitions with their steps — the complete list, never a page; enough to find a workflow's is_initial step. get_workflow gives the transitions, list_eligible_workflows the workflows applicable to a document.

ParameterTypeDescription
querystringCase-insensitive substring of the workflow name. Omit to list every workflow

get_workflow

Get the full definition of a workflow: all steps (states), transitions (directed edges between steps) and accepted_types — the document types it applies to, as [{type_id, type_name}]. Use to understand the complete lifecycle graph before transitioning a document.

ParameterTypeDescription
workflow_id *numberWorkflow ID

list_eligible_workflows

List the workflows that can be applied to a document, based on its document type. Returns each workflow with its steps. To put the document into a workflow, call set_document_status with the id of that workflow's is_initial step.

ParameterTypeDescription
document_id *numberDocument ID

list_next_steps

The valid transitions from a document's current workflow step — one hop, each with the step it leads to; pass a returned step_id to set_document_status. Empty when the document is in no workflow or on a terminal step. For the whole lifecycle graph call get_workflow; to reach a step several hops away give set_document_status the destination — it resolves the route.

ParameterTypeDescription
document_id *numberDocument ID

set_document_status

Change a document's workflow status — one document, or MANY in one call. (1) ENTER: the is_initial step_id from list_eligible_workflows; (2) TRANSITION: a step_id from list_next_steps; (3) EXIT: step_id=null (from a terminal step only); (4) BATCH: documents: [{document_id, step}] with step an id, a step NAME or label ("completed", "In Review") or null — names where each document must END UP and walks the route (several hops = one call); items succeed or fail on their own and each result reports path, the steps walked. Every result carries effects — what the move did to RELATED documents…

ParameterTypeDescription
document_idnumberDocument ID. Omit when passing documents
documentsarrayMove many documents at once. step: a step id, its name or label, or null to exit
notestringWhy this move happened — recorded on the document as a whole-document comment (`**in_progress → blocked** — waiting on legal review`), visible in the UI and notifying anyone you @mention. For a…
on_errorstringcontinue (default) attempts every item; abort stops at the first failure
step_idnull | numberTarget workflow step id to enter/transition to, or null to exit the workflow. Required with document_id.

guide

The CollHub guide by topic: the rules that span tools. The server instructions carry only its head (the house rules and the list of topics), and a client can drop them (Codex). If they did not reach you, call guide(["topic.index"]) once before the first CollHub call. Read a topic before the first call of its kind: topic.editing before an edit, topic.markdown before you write a body, topic.projects before a card or a plan, topic.workstreams before you create a stream. Ask for several topics in one call.

ParameterTypeDescription
items *arrayTopics to read, e.g. ["topic.editing", "topic.markdown"]