Skip to content

Commit 560e564

Browse files
anna239benbrandt
andauthored
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>
1 parent 5d9b7ff commit 560e564

File tree

8 files changed

+967
-420
lines changed

8 files changed

+967
-420
lines changed

docs/protocol/draft/schema.mdx

Lines changed: 254 additions & 154 deletions
Large diffs are not rendered by default.

docs/rfds/elicitation.mdx

Lines changed: 51 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
2-
title: "Elicitation: Structured User Input During Sessions"
2+
title: "Elicitation: Structured User Input"
33
---
44

55
- Author(s): [@yordis](https://github.com/yordis)
66
- Champion: [@benbrandt](https://github.com/benbrandt)
77

88
## Elevator pitch
99

10-
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.
1111

1212
## Status quo
1313

@@ -41,7 +41,7 @@ The mechanism would:
4141
- **Form mode** (in-band): Structured data collection via JSON Schema forms
4242
- **URL mode** (out-of-band): Browser-based flows for sensitive operations like OAuth (addressing PR #330 authentication pain points)
4343

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.
4545

4646
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.
4747

@@ -70,12 +70,13 @@ Clients can:
7070

7171
### Alignment with MCP
7272

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.
7474

7575
Key differences from MCP:
7676

77-
- MCP elicitation is tool-call-scoped; ACP elicitation is session-scoped
78-
- ACP uses `session/elicitation` method; MCP uses `elicitation/create`
77+
- 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)
7980
- ACP must integrate with existing Session Config Options (which also use schema constraints)
8081

8182
### Elicitation Request Structure
@@ -346,17 +347,18 @@ Clients use this schema to generate appropriate input forms, validate user input
346347

347348
### Elicitation Request
348349

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:
350351

351352
**Form mode example:**
352353

353354
```json
354355
{
355356
"jsonrpc": "2.0",
356357
"id": 43,
357-
"method": "session/elicitation",
358+
"method": "elicitation/create",
358359
"params": {
359360
"sessionId": "...",
361+
"toolCallId": "tc_123",
360362
"mode": "form",
361363
"message": "How would you like me to approach this refactoring?",
362364
"requestedSchema": {
@@ -385,9 +387,9 @@ The agent sends a `session/elicitation` request when it needs information from t
385387
{
386388
"jsonrpc": "2.0",
387389
"id": 44,
388-
"method": "session/elicitation",
390+
"method": "elicitation/create",
389391
"params": {
390-
"sessionId": "...",
392+
"requestId": 12,
391393
"mode": "url",
392394
"elicitationId": "github-oauth-001",
393395
"url": "https://agent.example.com/connect?elicitationId=github-oauth-001",
@@ -396,6 +398,37 @@ The agent sends a `session/elicitation` request when it needs information from t
396398
}
397399
```
398400

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+
399432
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.
400433

401434
### User Response
@@ -460,7 +493,7 @@ sequenceDiagram
460493
participant Agent
461494
462495
Note over Agent: Agent initiates elicitation
463-
Agent->>Client: session/elicitation (mode: form)
496+
Agent->>Client: elicitation/create (mode: form)
464497
465498
Note over User,Client: Present elicitation UI
466499
User-->>Client: Provide requested information
@@ -481,7 +514,7 @@ sequenceDiagram
481514
participant Agent
482515
483516
Note over Agent: Agent initiates elicitation
484-
Agent->>Client: session/elicitation (mode: url)
517+
Agent->>Client: elicitation/create (mode: url)
485518
486519
Client->>User: Present consent to open URL
487520
User-->>Client: Provide consent
@@ -491,7 +524,7 @@ sequenceDiagram
491524
492525
Note over User,UserAgent: User interaction
493526
UserAgent-->>Agent: Interaction complete
494-
Agent-->>Client: notifications/elicitation/complete (optional)
527+
Agent-->>Client: elicitation/complete (optional)
495528
496529
Note over Agent: Continue processing with new information
497530
```
@@ -519,19 +552,19 @@ sequenceDiagram
519552
Note over User,UserAgent: User interaction
520553
521554
UserAgent-->>Agent: Interaction complete
522-
Agent-->>Client: notifications/elicitation/complete (optional)
555+
Agent-->>Client: elicitation/complete (optional)
523556
524557
Client->>Agent: Retry original request (optional)
525558
```
526559

527560
### Completion Notifications for URL Mode
528561

529-
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:
530563

531564
```json
532565
{
533566
"jsonrpc": "2.0",
534-
"method": "notifications/elicitation/complete",
567+
"method": "elicitation/complete",
535568
"params": {
536569
"elicitationId": "github-oauth-001"
537570
}
@@ -584,7 +617,7 @@ Agents MUST return standard JSON-RPC errors for common failure cases:
584617

585618
Clients MUST return standard JSON-RPC errors for common failure cases:
586619

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)
588621

589622
### Client Capabilities
590623

@@ -725,7 +758,7 @@ From PR #330: URL-mode elicitation allows agents to request authentication witho
725758
7. User authenticates and grants permission
726759
8. OAuth provider redirects back to the agent's redirect_uri
727760
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
729762

730763
**Key guarantees**:
731764

schema/meta.unstable.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@
2626
"session_set_model": "session/set_model"
2727
},
2828
"clientMethods": {
29+
"elicitation_complete": "elicitation/complete",
30+
"elicitation_create": "elicitation/create",
2931
"fs_read_text_file": "fs/read_text_file",
3032
"fs_write_text_file": "fs/write_text_file",
31-
"session_elicitation": "session/elicitation",
32-
"session_elicitation_complete": "session/elicitation/complete",
3333
"session_request_permission": "session/request_permission",
3434
"session_update": "session/update",
3535
"terminal_create": "terminal/create",

0 commit comments

Comments
 (0)