analyze

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

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

Handler wraps the cvemap.Client for faceted vulnerability analysis operations.

func NewHandler

func NewHandler(client *cvemap.Client) *Handler

NewHandler constructs a new Handler instance.

func (*Handler) Analyze

func (h *Handler) Analyze(params Params) (cvemap.SearchResponse, error)

Analyze performs a facet-based aggregation over vulnerabilities. Callers must provide at least one term facet via Params.Fields. The function sets Fields to ["doc_id"] and Limit to 1 to minimise response size as we are only interested in the aggregation buckets.

func (*Handler) MCPHandler

func (h *Handler) MCPHandler(client *cvemap.Client) func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error)

MCPHandler returns the MCP handler for this tool.

func (*Handler) MCPToolSpec

func (h *Handler) MCPToolSpec() mcp.Tool

MCPToolSpec returns the MCP tool specification for vulnerability analysis

type Params

type Params struct {
	// Fields represents the list of facet expressions the caller wishes to
	// compute. Each expression can optionally set a custom size using the
	// "field=size" syntax (e.g. "severity=5").
	Fields []string

	// Query is an optional Bleve query expression that filters the documents
	// before the facet aggregation is executed.
	Query *string

	// FacetSize sets the default number of buckets to return for any facet
	// expression that does not explicitly override its size via the
	// "field=size" form. If nil the server default is used.
	FacetSize *int
}

Params groups the parameters for faceted vulnerability analysis

Jump to

Keyboard shortcuts

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