Find or create organizational context
dm.ensure_contextIdempotently find or create one Project, Decision Thread, Repository Scope or Environment by its normalized name and return its canonical id with created=true|false. Requires the delegated human's OAuth grant and a workspace role that permits the change. Repository Scopes are name-only: nothing is connected, fetched, cloned or indexed. If several items already match, it returns ambiguous_match with candidate ids instead of choosing one.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"kind": "<kind>",
"name": "<name>"
},
"name": "dm.ensure_context"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | No | Project only: explicit short key. Derived from the name when omitted. | |
| kind | Yes | ||
| name | Yes | Display name (thread title for decision_thread). Matched by normalized name. | |
| project_id | No | Decision thread only: scope the match to this project and link a newly created thread to it. Omitted: the match spans the whole workspace and a new thread is created without a project. | |
| description | No | Decision thread only: used when the thread is created; never overwrites an existing one. |