Documentation
¶
Index ¶
- Constants
- func CreateManPageSchema() *jsonschema.Schema
- func GetManPage(ctx context.Context, req *mcp.CallToolRequest, params *GetManPageParams) (*mcp.CallToolResult, any, error)
- func IsManAvailable() bool
- func SetExecutor(e Executor)
- type DefaultExecutor
- type Executor
- type GetManPageParams
- type ManPageResult
Constants ¶
View Source
const (
ValidManSectionPattern = `^[a-zA-Z0-9]+$`
)
Variables ¶
This section is empty.
Functions ¶
func CreateManPageSchema ¶
func CreateManPageSchema() *jsonschema.Schema
func GetManPage ¶
func GetManPage(ctx context.Context, req *mcp.CallToolRequest, params *GetManPageParams) (*mcp.CallToolResult, any, error)
func IsManAvailable ¶ added in v0.3.4
func IsManAvailable() bool
IsManAvailable checks if the man binary is available in PATH. Returns true if man is found, false otherwise.
func SetExecutor ¶ added in v0.3.0
func SetExecutor(e Executor)
Types ¶
type DefaultExecutor ¶ added in v0.3.0
type DefaultExecutor struct{}
DefaultExecutor uses os/exec to run commands.
type Executor ¶ added in v0.3.0
type Executor interface {
Run(ctx context.Context, name string, args ...string) ([]byte, []byte, error)
}
Executor interface for running external commands.
type GetManPageParams ¶
type GetManPageParams struct {
Name string `json:"name" jsonschema:"Name of the man page"`
Section string `json:"section,omitempty" jsonschema:"Section of the man page (default 1, e.g., 1, 8, 8p, 3perl)"`
Offset int `json:"offset,omitempty" jsonschema:"Line offset for pagination"`
Limit int `json:"limit,omitempty" jsonschema:"Maximum number of lines to return (default 500)"`
Chapters []string `json:"chapters,omitempty" jsonschema:"List of chapters to retrieve (e.g. ['NAME', 'SYNOPSIS'])"`
}
type ManPageResult ¶
Click to show internal directories.
Click to hide internal directories.