sysinfo

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2026 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(logger zerolog.Logger) tools.Tool

Types

type CPUInfo

type CPUInfo struct {
	Model     string `json:"model"`
	Cores     int    `json:"cores"`
	Threads   int    `json:"threads"`
	LoadAvg1  string `json:"load_avg_1min"`
	LoadAvg5  string `json:"load_avg_5min"`
	LoadAvg15 string `json:"load_avg_15min"`
	Usage     string `json:"usage_percent"`
}

type Input

type Input struct {
	SSHHost  string `json:"ssh_host,omitempty" validate:"omitempty,hostname|ip"`                           // SSH host for remote execution
	SSHPort  int    `json:"ssh_port,omitempty" validate:"min=0,max=65535"`                                 // SSH port for remote execution (default: 22)
	SSHUser  string `json:"ssh_user,omitempty" validate:"omitempty,alphanum|contains=-|contains=_,max=32"` // SSH user for remote execution
	MaxLines int    `json:"max_lines,omitempty" validate:"min=0,max=100000"`                               // Maximum lines to return (default: 1000)
	Offset   int    `json:"offset,omitempty" validate:"min=0"`                                             // Line offset for pagination
}

type MemoryInfo

type MemoryInfo struct {
	TotalMB      int    `json:"total_mb"`
	UsedMB       int    `json:"used_mb"`
	FreeMB       int    `json:"free_mb"`
	AvailableMB  int    `json:"available_mb"`
	CachedMB     int    `json:"cached_mb"`
	SwapTotalMB  int    `json:"swap_total_mb"`
	SwapUsedMB   int    `json:"swap_used_mb"`
	SwapFreeMB   int    `json:"swap_free_mb"`
	UsagePercent string `json:"usage_percent"`
}

type SystemInfo

type SystemInfo struct {
	CPUInfo    CPUInfo    `json:"cpu_info"`
	MemoryInfo MemoryInfo `json:"memory_info"`
	Hostname   string     `json:"hostname"`
	Kernel     string     `json:"kernel"`
	OS         string     `json:"os"`
	Uptime     string     `json:"uptime"`
}

type Tool

type Tool struct {
	// contains filtered or unexported fields
}

func (*Tool) Register

func (s *Tool) Register(srv *server.Server)

func (*Tool) SysInfoHandler

func (s *Tool) SysInfoHandler(ctx context.Context, _ *mcp.CallToolRequest, input Input) (*mcp.CallToolResult, SystemInfo, error)

Jump to

Keyboard shortcuts

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