elicitation

package
v0.0.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 15, 2026 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package elicitation provides typed structures for MCP elicitation handling.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action string

Action identifies the SDK consumer's response to an elicitation request.

const (
	// ActionAccept accepts the elicitation and optionally returns content.
	ActionAccept Action = "accept"
	// ActionDecline declines the elicitation.
	ActionDecline Action = "decline"
	// ActionCancel cancels the elicitation flow.
	ActionCancel Action = "cancel"
)

type Callback

type Callback func(ctx context.Context, req *Request) (*Response, error)

Callback handles an MCP elicitation request.

type Mode

type Mode string

Mode identifies the elicitation UX expected by the CLI.

const (
	// ModeForm requests a form-style elicitation.
	ModeForm Mode = "form"
	// ModeURL requests a URL-based elicitation.
	ModeURL Mode = "url"
)

type Request

type Request struct {
	MCPServerName   string
	Message         string
	Mode            *Mode
	URL             *string
	ElicitationID   *string
	RequestedSchema map[string]any
	ThreadID        string
	TurnID          *string
	Audit           *message.AuditEnvelope `json:"-"`
}

Request contains an MCP elicitation request from the CLI.

type Response

type Response struct {
	Action  Action
	Content map[string]any
	Audit   *message.AuditEnvelope `json:"-"`
}

Response contains the SDK consumer's elicitation decision.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL