Contexts and namespaces
Almost every “the app tools don’t work” report comes down to a missing context. This is the shape of it.
The hierarchy
Section titled “The hierarchy”- An application is installed WASM plus its ABI. Installing it creates no state.
- A namespace is the governance unit: it owns members and an upgrade policy, and is created for an application.
- A context is where state actually lives and where calls execute. It belongs to a namespace and runs one application (one service of it, for a multi-service app).
So a method call needs a context, a context needs a namespace, and a namespace needs an installed application.
From nothing to a callable app
Section titled “From nothing to a callable app”-
Install the application (or confirm it is installed):
Call list_applications.To add one,
install_applicationtakes aurland an optionalhash. -
Create a namespace for it:
Call create_namespace with application "kv-store".upgradePolicyisAutomaticunless you passLazyOnAccess. The result carries the namespace id. -
Create a context in that namespace:
Call create_context with application "kv-store" and namespace "<namespace-id>".For a multi-service application, pass
servicetoo —describe_appreports the service names existing contexts use, and that is the value this wants. -
Select the app and call it:
Select kv-store, then call its get method for key "greeting".With exactly one context,
select_apppins it automatically.
Aliases
Section titled “Aliases”Context ids are base58 and unmemorable. An alias fixes that for the whole node, not just this session:
Create an alias "staging" for context 8Hk2….create_alias takes alias and contextId; lookup_alias resolves one back. A
lookup that misses is reported as a result, not an error — “No alias named …” is a
true answer to a fair question.
Anywhere a tool takes a context — _context on a generated tool, context on
call, select_app’s pin — an alias works in place of the id. Resolved aliases are
cached for the session.
Members
Section titled “Members”Namespace membership is governance, and lives in the governance toolset:
invite_to_namespacemints an invitation for a namespace.join_namespaceaccepts one.leave_namespaceleaves.list_group_members/add_group_membersinspect and extend a group’s roster. Members are added as{ identity, role }pairs.
Deleting things, in the right order
Section titled “Deleting things, in the right order”Delete contexts before their namespace. Contexts outlive the namespace they
belonged to, and a context whose namespace is gone is uncallable but still present —
holding its data and showing up in list_contexts:
1. delete_context for each context in the namespace2. delete_namespaceIf you already deleted the namespace first, delete_context is still the fix — it
is what clears a context stranded that way.
delete_context takes an optional requester, the member identity to delete as,
needed only when the node holds several.
delete_context, delete_namespace, uninstall_application, delete_blob and
leave_namespace are all marked destructive, so a client that surfaces that hint
can prompt before running them.
The blobs toolset covers node storage: upload_blob (base64 bytes, optional
hash, optional context to scope it), list_blobs, delete_blob, plus
install_application / uninstall_application. Application bytecode is a blob,
which is why they share a toolset.
Both blobs and governance are on by default and can be trimmed with
CALIMERO_MCP_TOOLSETS when you want a
smaller, read-mostly tool list.