Documentation
¶
Overview ¶
Package tools holds the read-only MCP tools served on the mcpservers/mcp subresource (designs-and-proposals storage-mcp-endpoint.md). They read only through Reader, so they do not depend on how the data is fetched or how the caller's access is checked.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorResult ¶ added in v0.0.391
ErrorResult is the tool error result with code, message and details.
Types ¶
type ErrorCode ¶
type ErrorCode string
ErrorCode is the code of a tool error. The codes and the ToolError shape are the ones kubescape mcpserver uses, so agents handle both the same way.
const ( ErrCodeResourceNotFound ErrorCode = "RESOURCE_NOT_FOUND" ErrCodeRBACDenied ErrorCode = "RBAC_DENIED" ErrCodeInvalidArgument ErrorCode = "INVALID_ARGUMENT" ErrCodeTimeout ErrorCode = "TIMEOUT" // ErrCodeResponseTooLarge is the answer to a call whose result is above // the endpoint's size cap. ErrCodeResponseTooLarge ErrorCode = "RESPONSE_TOO_LARGE" )
type Reader ¶
type Reader interface {
ListVulnerabilityManifests(ctx context.Context, namespace string, opts metav1.ListOptions) (*v1beta1.VulnerabilityManifestList, error)
GetVulnerabilityManifest(ctx context.Context, namespace, name string) (*v1beta1.VulnerabilityManifest, error)
ListSBOMSyfts(ctx context.Context, namespace string, opts metav1.ListOptions) (*v1beta1.SBOMSyftList, error)
GetSBOMSyft(ctx context.Context, namespace, name string) (*v1beta1.SBOMSyft, error)
ListWorkloadConfigurationScans(ctx context.Context, namespace string, opts metav1.ListOptions) (*v1beta1.WorkloadConfigurationScanList, error)
GetWorkloadConfigurationScan(ctx context.Context, namespace, name string) (*v1beta1.WorkloadConfigurationScan, error)
ListContainerProfiles(ctx context.Context, namespace string, opts metav1.ListOptions) (*v1beta1.ContainerProfileList, error)
GetContainerProfile(ctx context.Context, namespace, name string) (*v1beta1.ContainerProfile, error)
}
Reader is what the tools read from. A denied read returns a Forbidden error, as the Kubernetes API does.
Click to show internal directories.
Click to hide internal directories.