Understanding the core conversation flow
session/prompt
:
session/update
notifications. This may include the Agent’s plan for accomplishing the task:
session/prompt
request with a StopReason
:
StopReason
.
session/request_permission
method.
Once permission is granted (if required), the Agent SHOULD invoke the tool and report a status update marking the tool as in_progress
:
fs
) methods to access resources within the Client’s environment.
When the tool completes, the Agent sends another update with the final status and any content:
StopReason
:
session/cancel
notification:
cancelled
as soon as it sends the session/cancel
notification.
The Client MUST respond to all pending session/request_permission
requests with the cancelled
outcome.
When the Agent receives this notification, it SHOULD stop all language model requests and all tool call invocations as soon as possible.
After all ongoing operations have been successfully aborted and pending updates have been sent, the Agent MUST respond to the original session/prompt
request with the cancelled
stop reason.
session/prompt
.Clients often display unrecognized errors from the Agent to the user, which would be undesirable for cancellations as they aren’t considered errors.Agents MUST catch these errors and return the semantically meaningful cancelled
stop reason, so that Clients can reliably confirm the cancellation.session/update
notifications with content or tool call updates after receiving the session/cancel
notification, but it MUST ensure that it does so before responding to the session/prompt
request.
The Client SHOULD still accept tool call updates received after sending session/cancel
.
session/prompt
to continue the conversation, building on the context established in previous turns.