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_applicationtakescoordsaspackage@version.For an app you have not used before, call
describe_appnext. Its guide can ask for a particular layout, such as a context in an open subgroup rather than straight in the namespace. -
Create a namespace for it:
Call create_namespace with application "kv-store".The result carries the namespace id.
-
Create a context in that namespace:
Call create_context with application "kv-store" and group "<namespace-id>".grouptakes a namespace id or the id of a subgroup inside one, for an app whose guide sets its contexts up in a subgroup.For a multi-service application, pass
servicetoo —describe_appreports the service names existing contexts use, and that is the value this wants.If the app’s
inittakes parameters (describe_applistsinitwith them), pass them asargs, keyed by parameter name - for exampleargs {"name": "world-1", "seed": 42, "now": 1727000000}for mero-blocks. They are checked against the ABI before anything reaches the node. Leaving them out, getting one wrong, or passing oneinitdoes not declare returns an error naming each missing, invalid or unknown parameter, with theinitsignature, and creates nothing. -
Select the app and call it:
Select kv-store, then call its get method for key "greeting".With exactly one context,
select_appchooses it, and theapp_handleit returns names it.
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, including select_app’s context, 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, 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.