ElicitationResult API

July 14, 2026 ยท View on GitHub

Available when inheriting from ClaudeHooks::ElicitationResult:

Runs after a user has responded to an elicitation dialog. Can override the action or content before it is sent back to the MCP server.

Input Helpers

๐Ÿ“š Shared input helpers

MethodDescription
mcp_server_nameThe MCP server that requested input
actionThe user's chosen action: 'accept', 'decline', or 'cancel'
modeOptional interaction mode
elicitation_idOptional unique ID for this elicitation
contentThe content the user provided (for 'accept' action)

Hook State Helpers

๐Ÿ“š Shared hook state methods

MethodDescription
accept!(content = {})Override the response with an accept + content
decline!Override the response to decline
cancel!Override the response to cancel

Output Helpers

๐Ÿ“š Shared output helpers

MethodDescription
output.actionGet the (possibly overridden) action
output.contentGet the (possibly overridden) content
output.accepted?Check if the action is 'accept'
output.declined?Check if the action is 'decline'
output.cancelled?Check if the action is 'cancel'

Hook Exit Codes

Uses the JSON API (exit 0 / stdout).