destructive: true, execution pauses until a human approves or denies the action.
The elicitation lifecycle
ElicitationEngine
TheElicitationEngine class manages the full lifecycle:
Key methods
| Method | Description |
|---|---|
gate(tool, args) | Gates destructive tool calls. Returns immediately for safe tools. |
resolve(executionId, approved, data?) | Resolves a pending elicitation. Returns true if found. |
getPending(executionId) | Get a specific pending elicitation |
getAllPending() | Get all pending elicitations |
hasPending() | Check if any elicitations are pending |
addSessionApproval(toolPath) | Auto-approve future calls to this tool path |
isSessionApproved(toolPath) | Check if a tool path is session-approved |
clearSessionApprovals() | Reset all session approvals |
Session approvals
Once a user approves a tool, the engine can remember the approval for the session. Subsequent calls to the same tool path auto-approve without pausing:Using elicit() in plugin handlers
Inside a tool handler, callctx.elicit() to request approval:
elicit() function takes a single object parameter:
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
toolPath | string | Yes | — | Tool requesting approval |
message | string | Yes | — | Human-readable description |
args | object | No | — | Arguments being approved |
type | string | No | "approval" | "approval" for yes/no, "form" for data collection |
ElicitationResponse:
| Field | Type | Description |
|---|---|---|
executionId | string | Unique elicitation ID |
approved | boolean | Whether the user approved |
data | object | Additional data (for form type) |
Elicitation types
approval— simple yes/no confirmation. The most common type.form— collect additional data from the user. The response includes adataobject with the user’s input.