Conversation programs: answer, assign, close
The Conversation Verbs answer, assign, close as MCP do programs, with inputs, result, refusals and an example.
Reference for Conversation, one group of Conversation programs.
Conversation.answer
Answer replies in a Conversation through the Channel it arrived on and closes the reply Task it opened. Verb page.
do: return await $.Conversation.answer(input)Emits Conversation.answered.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
conversation | Conversation | required | The Conversation that waits. |
body | text | required | The reply. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
conversation | Conversation | required | The answered Conversation. |
Refuses when
| Check | Error | Fix | Then call |
|---|---|---|---|
| The key is valid, but its scopes do not allow this operation. | forbidden | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
| The record is not in a state that allows this Verb, so the call is refused. | refused | Read the record, run the Verb that moves it to an allowed state, then retry. | None. |
Example
{
"name": "do",
"arguments": {
"code": "return await $.Conversation.answer({ conversation: 'conversation_0vg6SDjB6k', body: 'Example body' })"
}
}Conversation.assign
Assign routes a Conversation to the Worker holding the right Role, by topic, Customer tier and language. Verb page.
do: return await $.Conversation.assign(input)Emits Conversation.assigned.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
conversation | Conversation | required | The Conversation to route. |
worker | Worker | The Worker to take it; omitted, the routing Policy picks. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
conversation | Conversation | required | The Conversation, with its Worker. |
Refuses when
| Check | Error | Fix | Then call |
|---|---|---|---|
| The key is valid, but its scopes do not allow this operation. | forbidden | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
Example
{
"name": "do",
"arguments": {
"code": "return await $.Conversation.assign({ conversation: 'conversation_0vg6SDjB6k' })"
}
}Conversation.close
Close marks a Conversation resolved, confirmed by the Customer or assumed after 72 hours with no reply. Verb page.
do: return await $.Conversation.close(input)Emits Conversation.closed.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
conversation | Conversation | required | The answered Conversation. |
resolution | string | required | How it ended: the Customer said so, or 72 hours passed after an answer with no reply. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
conversation | Conversation | required | The Conversation, resolved. |
Refuses when
| Check | Error | Fix | Then call |
|---|---|---|---|
| The key is valid, but its scopes do not allow this operation. | forbidden | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
Example
{
"name": "do",
"arguments": {
"code": "return await $.Conversation.close({ conversation: 'conversation_0vg6SDjB6k', resolution: 'confirmed' })"
}
}