You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(unstable): elicitation for session, tool call, and requests (#792)
* update elicitation mechanism to allow for elicitations outside of the session scope
* Add ability to provide toolCallId
* Add ability to provide toolCallId
* Cleanup (also fix nested action)
* More clean up
* Clean up constructors
* Nest scope
* Flatten ids again
* Clean up docs
* Remove unneeded inline
---------
Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
Add support for agents to request structured information from users during a session through a standardized elicitation mechanism, aligned with [MCP's elicitation feature](https://modelcontextprotocol.io/specification/draft/client/elicitation). This allows agents to ask follow-up questions, collect authentication credentials, gather preferences, and request required information without side-channel communication or ad-hoc client UI implementations.
10
+
Add support for agents to request structured information from users through a standardized elicitation mechanism, aligned with [MCP's elicitation feature](https://modelcontextprotocol.io/specification/draft/client/elicitation). This allows agents to ask follow-up questions, collect authentication credentials, gather preferences, and request required information without side-channel communication or ad-hoc client UI implementations.
11
11
12
12
## Status quo
13
13
@@ -41,7 +41,7 @@ The mechanism would:
41
41
-**Form mode** (in-band): Structured data collection via JSON Schema forms
42
42
-**URL mode** (out-of-band): Browser-based flows for sensitive operations like OAuth (addressing PR #330 authentication pain points)
43
43
44
-
3.**Request/response pattern**: Agents send elicitation requests via a `session/elicitation` method and receive responses. The agent controls when to send requests and whether to wait for responses before proceeding. Unlike Session Config Options (which are persistent), elicitation requests are transient.
44
+
3.**Request/response pattern**: Agents send elicitation requests via an `elicitation/create` method and receive responses. The agent controls when to send requests and whether to wait for responses before proceeding. Unlike Session Config Options (which are persistent), elicitation requests are transient.
45
45
46
46
4.**Support client capability negotiation**: Clients declare elicitation support via a structured capability object that distinguishes between `form`-based and `url`-based elicitation (following MCP's capability model). This allows clients to support one or both modalities, enables agents to pass capabilities along to MCP servers, and handles graceful degradation when clients have limited elicitation support.
47
47
@@ -70,12 +70,13 @@ Clients can:
70
70
71
71
### Alignment with MCP
72
72
73
-
This proposal follows MCP's draft elicitation specification. See [MCP Elicitation Specification](https://modelcontextprotocol.io/specification/draft/client/elicitation) for detailed guidance. ACP uses the same JSON Schema constraint approach and capability model, adapted for our session/turn-based architecture.
73
+
This proposal follows MCP's draft elicitation specification. See [MCP Elicitation Specification](https://modelcontextprotocol.io/specification/draft/client/elicitation) for detailed guidance. ACP uses the same JSON Schema constraint approach and capability model, adapted for ACP interactions.
74
74
75
75
Key differences from MCP:
76
76
77
-
- MCP elicitation is tool-call-scoped; ACP elicitation is session-scoped
- MCP elicitation is tool-call-scoped; ACP elicitation may be tool-call-scoped, session-scoped, or request-scoped
78
+
- ACP uses `elicitation/create` method (same as MCP)
79
+
- ACP includes an optional `toolCallId` field to support tool-call-scoped elicitations (e.g., when an agent receives an MCP elicitation during a tool call and needs to redirect it to the user)
79
80
- ACP must integrate with existing Session Config Options (which also use schema constraints)
80
81
81
82
### Elicitation Request Structure
@@ -346,17 +347,18 @@ Clients use this schema to generate appropriate input forms, validate user input
346
347
347
348
### Elicitation Request
348
349
349
-
The agent sends a `session/elicitation` request when it needs information from the user:
350
+
The agent sends an `elicitation/create` request when it needs information from the user:
350
351
351
352
**Form mode example:**
352
353
353
354
```json
354
355
{
355
356
"jsonrpc": "2.0",
356
357
"id": 43,
357
-
"method": "session/elicitation",
358
+
"method": "elicitation/create",
358
359
"params": {
359
360
"sessionId": "...",
361
+
"toolCallId": "tc_123",
360
362
"mode": "form",
361
363
"message": "How would you like me to approach this refactoring?",
362
364
"requestedSchema": {
@@ -385,9 +387,9 @@ The agent sends a `session/elicitation` request when it needs information from t
@@ -396,6 +398,37 @@ The agent sends a `session/elicitation` request when it needs information from t
396
398
}
397
399
```
398
400
401
+
The scope fields are flattened at the top level of the request. Elicitation supports two scoping variants:
402
+
403
+
-**Session scope**: `sessionId` is set — tied to a specific session. Optionally includes `toolCallId` when tied to a specific tool call within that session (e.g., when an agent receives an elicitation from an MCP server during a tool call and needs to redirect it to the user).
404
+
-**Request scope**: `requestId` is set — tied to a specific JSON-RPC request outside of a session (e.g., auth/configuration phases before any session is started).
405
+
406
+
**Request-scoped example:**
407
+
408
+
```json
409
+
{
410
+
"jsonrpc": "2.0",
411
+
"id": 45,
412
+
"method": "elicitation/create",
413
+
"params": {
414
+
"requestId": 12,
415
+
"mode": "form",
416
+
"message": "Please provide your workspace name to continue setup.",
417
+
"requestedSchema": {
418
+
"type": "object",
419
+
"properties": {
420
+
"workspaceName": {
421
+
"type": "string",
422
+
"title": "Workspace Name",
423
+
"description": "The name of your workspace"
424
+
}
425
+
},
426
+
"required": ["workspaceName"]
427
+
}
428
+
}
429
+
}
430
+
```
431
+
399
432
The client presents the elicitation UI to the user. For form mode, the client generates appropriate input UI based on the JSON Schema. For URL mode, the client opens the URL in a secure browser context.
Following MCP, agents MAY send a `notifications/elicitation/complete` notification when an out-of-band interaction started by URL mode elicitation is completed:
562
+
Following MCP, agents MAY send an `elicitation/complete` notification when an out-of-band interaction started by URL mode elicitation is completed:
530
563
531
564
```json
532
565
{
533
566
"jsonrpc": "2.0",
534
-
"method": "notifications/elicitation/complete",
567
+
"method": "elicitation/complete",
535
568
"params": {
536
569
"elicitationId": "github-oauth-001"
537
570
}
@@ -584,7 +617,7 @@ Agents MUST return standard JSON-RPC errors for common failure cases:
584
617
585
618
Clients MUST return standard JSON-RPC errors for common failure cases:
586
619
587
-
- When the agent sends a `session/elicitation` request with a mode not declared in client capabilities: `-32602` (Invalid params)
620
+
- When the agent sends an `elicitation/create` request with a mode not declared in client capabilities: `-32602` (Invalid params)
588
621
589
622
### Client Capabilities
590
623
@@ -725,7 +758,7 @@ From PR #330: URL-mode elicitation allows agents to request authentication witho
725
758
7. User authenticates and grants permission
726
759
8. OAuth provider redirects back to the agent's redirect_uri
727
760
9. Agent exchanges the authorization code for tokens and stores them bound to the user's identity
728
-
10. Agent sends a `notifications/elicitation/complete` notification to inform the client
761
+
10. Agent sends an `elicitation/complete` notification to inform the client
0 commit comments