mcp

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const MCPVersion = "2025-03-26"

Variables

This section is empty.

Functions

func Format2FARequest

func Format2FARequest(taskID string, promptDetails string, sourceURI string) ([]byte, error)

func FormatDOMContent

func FormatDOMContent(taskID string, domData interface{}, mimeType string, sourceURI string, encoding string) ([]byte, error)

func FormatError

func FormatError(taskID string, err error, sourceURI string) ([]byte, error)

func FormatStatus

func FormatStatus(taskID, statusMsg string, sourceURI string) ([]byte, error)

Types

type Actor

type Actor struct {
	ID     string                 `json:"id"`
	Role   string                 `json:"role"`
	Custom map[string]interface{} `json:"custom,omitempty"`
}

type Content

type Content struct {
	MIMEType string                 `json:"mime_type"`
	Data     interface{}            `json:"data"`
	Encoding string                 `json:"encoding,omitempty"` // e.g., "base64"
	Custom   map[string]interface{} `json:"custom,omitempty"`
}

type Context

type Context struct {
	Metadata Metadata `json:"metadata"`
	Actors   []Actor  `json:"actors,omitempty"`
	Content  Content  `json:"content"`
	ParentID string   `json:"parent_id,omitempty"`
	Schema   string   `json:"schema,omitempty"`
}

type Message

type Message struct {
	MCPVersion string  `json:"mcp_version"`
	Context    Context `json:"context"`
	RequestID  string  `json:"request_id,omitempty"`
	TaskID     string  `json:"task_id,omitempty"`
}

func NewBaseMessage

func NewBaseMessage(taskID string) Message

type Metadata

type Metadata struct {
	SourceURI string                 `json:"source_uri,omitempty"`
	Timestamp time.Time              `json:"timestamp"`
	Custom    map[string]interface{} `json:"custom,omitempty"`
}

Jump to

Keyboard shortcuts

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