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.

FieldFormUse it to
web_urlhttps://marfa.example.com/i/<id>Share, or show a person a link to click
app_urlmarfa://<instance-id>/<id>Hand over from one app to another on the same device
  • web_url starts 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_url starts with http://localhost:<port>, which opens only on the computer that runs the server.
  • app_url names the instance by its ID, the instance_id that GET / answers, because an address can change and one app can hold several instances.
  • Both links stay the same in the bin.

/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 404 page.
  • 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.

marfa items link prints the web_url:

Terminal
marfa items link 01a1f167-3524-769f-bb84-884191bc60f2
https://marfa.example.com/i/01a1f167-3524-769f-bb84-884191bc60f2
  • --app prints the app_url, --json prints both, and --open opens 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.

On this page