protocol-chaos
v0.2.3Protocol Chaos: an open protocol for the matters a person holds, shared by every AI assistant they use.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
event_note
Record the user's words on an Event, or start a new Event with them. Changes nothing else (it gives a title only to an Event that has none). With eventId the words are appended; without it a new Event starts in state emerging, optionally titled and placed under parentEventId. Check the directory first so one matter does not become two. Verbatim rule: text is the user's actual words, trimmed and otherwise unchanged, never a summary or a third-person paraphrase such as "The user confirmed…"; when a message covers several Events, pass the part about this Event, still in the user's words. Interp…
| Parameter | Type | Description |
|---|---|---|
actor * | object | Who is writing: your own identity, e.g. {"kind": "agent", "id": "laptop"}. Never the owner or another writer. |
text * | string | The user's actual words, verbatim. Never a summary or a third-person paraphrase. |
accountSource | string | Whose words they are: user (default), agent_response (your own sentence, such as an inference) or authorized_external (relayed from an application the user authorized). |
eventId | string | An Event id from the directory or a receipt. |
parentEventId | string | For a new Event only: the larger Event it is part of. |
title | string | For a new Event, or an Event without a title: a name that identifies it on its own. |
via | string | Where the words came from when they were not said in this conversation, e.g. "example-export". |
event_record_expression
Record words together with the changes they support, atomically: set any of title, state, progress, facts (goal, constraint, plan), refs and metadata. To fold words recorded earlier into fields, pass that Account's accountId and its exact text instead of appending new words. Each supplied field replaces the stored one, so supply its complete current content and carry over what still holds; null removes a field. Mark your own inferences inside the fact text with their basis. Verbatim rule: text is the user's actual words, trimmed and otherwise unchanged, never a summary or a third-person paraph…
| Parameter | Type | Description |
|---|---|---|
actor * | object | Who is writing: your own identity, e.g. {"kind": "agent", "id": "laptop"}. Never the owner or another writer. |
eventId * | string | An Event id from the directory or a receipt. |
text * | string | The user's actual words, verbatim. Never a summary or a third-person paraphrase. |
accountId | string | An existing Account of this Event to ground the changes on. |
accountSource | string | Whose words they are: user (default), agent_response (your own sentence, such as an inference) or authorized_external (relayed from an application the user authorized). |
expectedVersion | integer | The Event's version from your last read or receipt. On VERSION_CONFLICT, read again and reconsider. |
set | object | Fields to replace, each with its complete current content; null removes a field. Inside facts, each supplied key replaces that fact and the others are unchanged. |
via | string | Where the words came from when they were not said in this conversation, e.g. "example-export". |
event_add_parent
Link an Event (child) as part of a larger Event (parent). Link only when it is plainly part of it or a step toward it; two separate trips are siblings. Ground the link on Accounts of the child or of the parent. Adding an existing link changes nothing; a link that would close a cycle fails with PART_OF_CYCLE. Returns {eventId, version, parents} for the child.
| Parameter | Type | Description |
|---|---|---|
actor * | object | Who is writing: your own identity, e.g. {"kind": "agent", "id": "laptop"}. Never the owner or another writer. |
childEventId * | string | An Event id from the directory or a receipt. |
parentEventId * | string | An Event id from the directory or a receipt. |
sourceAccountIds * | array | At least one Account of the child or of the parent that the link rests on. |
expectedVersion | integer | The child's version. |
event_remove_parent
Remove the link "child is part of parent", grounded on Accounts of the child or of the parent. Removing a link that does not exist fails with NOT_FOUND. Returns {eventId, version, parents} for the child.
| Parameter | Type | Description |
|---|---|---|
actor * | object | Who is writing: your own identity, e.g. {"kind": "agent", "id": "laptop"}. Never the owner or another writer. |
childEventId * | string | An Event id from the directory or a receipt. |
parentEventId * | string | An Event id from the directory or a receipt. |
sourceAccountIds * | array | At least one Account of the child or of the parent that the link rests on. |
expectedVersion | integer | The child's version. |
event_get_protocol
Read one Event: {event, accounts, entities?}, the document, its most recent Accounts (default 20, or "all"), oldest first, and, when its refs name Entities, those Entities as {id, kind, name}. History is read with event_get_revisions.
| Parameter | Type | Description |
|---|---|---|
eventId * | string | An Event id from the directory or a receipt. |
accounts |
context_pack
The directory: every Event in brief, {id, title?, state, parents, progress?, updatedAt}, most recently updated first, from which you decide what to read. Pass sinceVersion (the version you cached) to learn whether anything changed; filter by state (a state, "open" or "closed"); page with limit and cursor (pass next).
| Parameter | Type | Description |
|---|---|---|
cursor | string | |
limit | integer | |
sinceVersion | string | |
state | string |
event_get_revisions
Read the history of an Event: its Revisions in commit order. Page with limit and after (pass next).
| Parameter | Type | Description |
|---|---|---|
eventId * | string | An Event id from the directory or a receipt. |
after | string | |
limit | integer |
event_search
Find Events for a query you chose, such as the name of a matter, before creating one (so one matter does not become two). Matching is by words, not by meaning: every Event whose title contains the query (ignoring case) comes first, then Events whose facts, progress, refs or recorded words contain it, then Events that hold every word of the query. Returns {events} in brief, as in the directory, best matches first. Filter by state (a state, "open" or "closed"); limit caps the number returned.
| Parameter | Type | Description |
|---|---|---|
query * | string | The words to look for, such as the name of a matter. |
limit | integer | |
state | string |
event_words_since
The words recorded since a moment, for folding them into fields later or refreshing a cache. Returns {version, checkpoint, remaining, events}: each Event that gained Accounts after since, with its current title, state, facts, refs, progress and parents, and words, its new Accounts, oldest first. Pass checkpoint as the next since to continue; remaining counts the Accounts not yet returned. limit is the number of Events per batch (a batch never ends between two Accounts with the same createdAt). Going over the same words twice changes nothing, because each field write carries the complete curren…
| Parameter | Type | Description |
|---|---|---|
since * | string | A timestamp such as 2026-03-14T09:30:00.000Z: the checkpoint of your previous call, or an early time to read every word. |
limit | integer | The number of Events per batch. |
event_undo_revision
Undo the latest change of an Event that has not been undone: a field.changed, parent.added or parent.removed Revision (words recorded since do not count). Events and words are never removed, so event.created and account.added cannot be undone, nor can an undo. Anything else fails with REVISION_NOT_REVERSIBLE, for example after another writer changed the Event: read it again and reconsider. Records a revision.reverted Revision and returns it; call again on the next change to walk further back.
| Parameter | Type | Description |
|---|---|---|
actor * | object | Who is writing: your own identity, e.g. {"kind": "agent", "id": "laptop"}. Never the owner or another writer. |
revisionId * | string | The Revision to undo, from event_get_revisions. |
entity_search
Find the people, animals, things and places the user refers to (Entities), for example before creating one, so that one does not become two. Every Entity whose name or an alias equals the query (ignoring case) comes first, then names and aliases that start with or contain it, then Entities whose Statements contain it. Omit query to list every Entity; filter by kind. Returns {entities}: cards {id, kind, name, aliases?, owner?, version, statements}, where statements counts the Statements that are not outdated.
| Parameter | Type | Description |
|---|---|---|
kind | string | person, animal, thing or place (other kinds are kept as written). |
limit | integer | |
query | string | A name, alias or words to look for. |
entity_get
Read one Entity. entityId is an Entity id or "current_user" (the user's own Entity). view "summary" returns {entity, summary}: the short list of Statements meant to be loaded into every conversation (never sensitive ones). view "full" (default) returns {entity, statements}: the Statements that are not outdated, by topic, then by creation. includeHistory adds history (the outdated ones); includeEvents adds referencedBy (the Events whose refs name it); topics restricts the Statements returned.
| Parameter | Type | Description |
|---|---|---|
entityId * | string | An Entity id, or "current_user" for the owner. |
includeEvents | boolean | |
includeHistory | boolean | |
topics | array | |
view | string |
entity_create
Create an Entity: one specific person, animal, thing or place that recurs across Events or applications and has user-specific information to accumulate (otherwise use a {criteria} ref on the Event). Search first (entity_search). accountText holds the words it rests on; statements are its first facts, one fact each, 1 to 200 characters, with absolute dates. owner: true only for the user's own Entity (at most one). Verbatim rule: the words (text, accountText) are the user's actual words, trimmed and otherwise unchanged, never a summary or a third-person paraphrase; pass the part about this Entit…
| Parameter | Type | Description |
|---|---|---|
accountText * | string | The user's actual words this Entity rests on, verbatim. |
actor * | object | Who is writing: your own identity, e.g. {"kind": "agent", "id": "laptop"}. Never the owner or another writer. |
kind * | string | person, animal, thing or place. |
name * | string | What the user calls it. |
accountSource | string | Whose words they are: user (default), agent_response (your own sentence, such as an inference) or authorized_external (relayed from an application the user authorized). |
aliases | array | Other names; not the name itself, each once. |
owner | boolean | true only for the user's own Entity. |
statements | array | |
via | string | Where the words came from when they were not said in this conversation, e.g. "example-export". |
entity_record
Record words about an Entity together with what they change: name, aliases (the complete new list), add (new Statements; may supersede or conflict with existing ones), update (status, reason, sensitivity, inSummary of existing Statements) and support (existing Statements these words also support). Saying the same thing again is merged into the existing Statement as more evidence. A Statement resting on the user's words can be superseded, or its status changed, only by the user's own words (USER_WORDS_PROTECTED): add your version with conflictsWith instead. A disputed Statement becomes current…
| Parameter | Type | Description |
|---|---|---|
actor * | object | Who is writing: your own identity, e.g. {"kind": "agent", "id": "laptop"}. Never the owner or another writer. |
entityId * | string | An Entity id, or "current_user" for the owner. |
text * | string | The user's actual words, verbatim. Never a summary or a third-person paraphrase. |
accountSource | string | Whose words they are: user (default), agent_response (your own sentence, such as an inference) or authorized_external (relayed from an application the user authorized). |
add | array | |
aliases | array | The complete new list of aliases. |
expectedVersion | integer | The Entity's version from your last read or write. |
name | string | |
support | array | Existing Statements these words also support. |
update | array | |
via | string | Where the words came from when they were not said in this conversation, e.g. "example-export". |