Documentation
¶
Overview ¶
Package progress provides utilities for reporting progress in MCP tool handlers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ProgressReporter ¶
type ProgressReporter struct {
// contains filtered or unexported fields
}
ProgressReporter helps report progress in tool handlers. It needs access to the server instance to send progress notifications.
func NewProgressReporter ¶
func NewProgressReporter(ctx context.Context, token interface{}, server ServerLogic, session types.ClientSession) *ProgressReporter
NewProgressReporter creates a new progress reporter. token is now interface{}
func (*ProgressReporter) Report ¶
func (p *ProgressReporter) Report(message string) error
Report sends a progress update with the given message.
func (*ProgressReporter) ReportProgress ¶
func (p *ProgressReporter) ReportProgress(message string, percentage int) error
ReportProgress sends a progress update with percentage.
func (*ProgressReporter) Reportf ¶
func (p *ProgressReporter) Reportf(format string, args ...interface{}) error
Reportf sends a progress update with a formatted message.
type ServerLogic ¶ added in v0.1.11
type ServerLogic interface {
SendProgress(sessionID string, params protocol.ProgressParams) error
}
ServerLogic defines the methods the ProgressReporter needs from the server.
Click to show internal directories.
Click to hide internal directories.