progress

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: May 12, 2025 License: MIT Imports: 4 Imported by: 0

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.

Jump to

Keyboard shortcuts

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