Item links
The two links every item carries, one to share and one for apps on the same device, and what the page behind a shared link shows.
Marfa answers every item with two read-only links, web_url and app_url, in a read, a list, a search or the event stream. The server works them out each time it answers and never stores them, so no write sets them, and a type can't declare a field with either name (reserved names). The rules are in the contract's Item link section.
The two links
| Field | Form | Use it to |
|---|---|---|
web_url | https:// | Share, or show a person a link to click |
app_url | marfa:// | Hand over from one app to another on the same device |
web_urlstarts with the instance's sign-in address. When the address moves, the next read gives the new link, so keep the ID and read the link again rather than storing it.- With no sign-in address set,
web_urlstarts withhttp://localhost:<port>, which opens only on the computer that runs the server. app_urlnames the instance by its ID, theinstance_idthatGET /answers, because an address can change and one app can hold several instances.- Both links stay the same in the bin.
The page a shared link opens
/i/<id> answers a small page that opens the app_url at once, in whichever app on the device opens marfa:// links. The device decides which app that is. If nothing opens, the page says that no app on the device opens Marfa links.
- The page shows nothing of what it links to, not even whether it exists, to anyone, the signed-in owner included. It answers the same for an ID in use, one in the bin, one purged and one never used, because the server answers from the address alone. Showing the content is the app's job, under its own sign-in.
- Text that isn't a well-formed ID gets a
404page. - Neither page is kept in caches or search indexes, and a link on it sends no referrer.
The rules are in the contract's page that opens an item in an app.
Getting a link
marfa items link prints the web_url:
marfa items link 01a1f167-3524-769f-bb84-884191bc60f2https://marfa.example.com/i/01a1f167-3524-769f-bb84-884191bc60f2--appprints theapp_url,--jsonprints both, and--openopens the link with the system's opener.- A link from the bin still prints, with a note on standard error that it is in Recently Deleted.
- An agent gets both links from every MCP tool that answers an item or a summary of one, and the endpoint's instructions tell it to give the person the
web_url.