Offer the types a person can create
Read each type's creatable answer to fill a New menu with the types a person can add to, and learn what turns it off.
An app that lets a person add items, as a New menu does, needs to know which types to offer. Every type answers a boolean creatable: true when a person can create items of it. It is advice, not a permission. Marfa refuses no write because of it, and it says nothing about what your credential may write. You need a credential that reads types, which every credential does.
Read creatable
List types and Get a type answer creatable on each type. In the TypeScript example, marfa is a TypeScript SDK client.
marfa types list --jsonOffer a type when creatable is true and your credential can write it. Get an overview names the types the credential writes.
Other places give the same answer:
marfa types get <id>prints acreatableline.- A working copy holds it in its catalog:
marfa device types get <id> --json. - Over MCP,
marfa_overviewcalled withtypecarriescreatable: falseon a type a person can't create, and leaves it out otherwise.
What turns it off
| Type | creatable |
|---|---|
A system.* or app.* type | Always false. Both are hidden, and a person creates neither. |
Any other type Marfa ships, such as core.note | Always true |
| Any other type | false while connectors hold it read only, and true otherwise |
Connectors hold a type read only while both of these are true:
- At least one live connector lists the type in its
read_only_types, with a key that may write the type. - No live connector carries the type back. A connector carries it back when its key's type map grants write on the type and it doesn't list the type.
A connector is live while its key is neither revoked nor expired. A person who created an item of such a type would see no connector take it to the service the type's items come from.
Two kinds of connector say nothing about a type they don't list, so they neither hold it read only nor carry it back:
- A key that writes the type only through a bare
*. An entry such asuser.*does count. - A plugin's connector that reaches the type only through its mapping. The type is the owner's own, so it stays
true.
Items of a read-only type
The same list marks items. An item reads read_only: true only while every live connector of its source lists the item's type and may write it. That is advice too: Marfa accepts an edit, and the connector puts its own value back on its next run. Don't offer to edit such an item.
Keep the answer current
- Read it again when a connector changes. The next read of the type follows a change to a connector's
read_only_types, or to its key. - Don't key it on
revision. Marfa workscreatableout at each read and never stores it, so a change to it alone leaves the type'srevisionas it was. - Send a type back as you read it. Register a type, Replace a type and Normalize a type definition take a
creatablein the body and ignore it. - Every credential gets the same answer.
The rules are in the contract's types chapter, under What a person can create.