Documentation
¶
Overview ¶
Package dependencies implements MCP tool handlers for GitLab dependency listing and dependency list export (SBOM) operations. It wraps the Dependencies and DependencyListExport services from client-go v2.
markdown.go provides Markdown formatting for dependency outputs.
register.go wires dependency MCP tools to the MCP server.
Index ¶
- func FormatDownloadMarkdown(d DownloadOutput) string
- func FormatExportMarkdown(e ExportOutput) string
- func FormatListMarkdown(out ListOutput) string
- func RegisterTools(server *mcp.Server, client *gitlabclient.Client)
- type CreateExportInput
- type DownloadExportInput
- type DownloadOutput
- type ExportOutput
- type GetExportInput
- type LicenseOutput
- type ListInput
- type ListOutput
- type Output
- type VulnerabilityOutput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatDownloadMarkdown ¶
func FormatDownloadMarkdown(d DownloadOutput) string
FormatDownloadMarkdown renders the downloaded SBOM content as Markdown.
func FormatExportMarkdown ¶
func FormatExportMarkdown(e ExportOutput) string
FormatExportMarkdown renders a dependency list export status as Markdown.
func FormatListMarkdown ¶
func FormatListMarkdown(out ListOutput) string
FormatListMarkdown renders a paginated list of dependencies as Markdown.
func RegisterTools ¶
func RegisterTools(server *mcp.Server, client *gitlabclient.Client)
RegisterTools registers dependency tools on the MCP server.
Types ¶
type CreateExportInput ¶
type CreateExportInput struct {
PipelineID int64 `json:"pipeline_id" jsonschema:"Pipeline ID to export dependencies from,required"`
ExportType string `json:"export_type,omitempty" jsonschema:"Export type (default: sbom)"`
}
CreateExportInput defines parameters for creating a dependency list export.
type DownloadExportInput ¶
type DownloadExportInput struct {
ExportID int64 `json:"export_id" jsonschema:"Dependency list export ID,required"`
}
DownloadExportInput defines parameters for downloading a dependency list export.
type DownloadOutput ¶
type DownloadOutput struct {
toolutil.HintableOutput
Content string `json:"content"`
}
DownloadOutput holds the raw content of a downloaded SBOM export.
func DownloadExport ¶
func DownloadExport(ctx context.Context, client *gitlabclient.Client, input DownloadExportInput) (DownloadOutput, error)
DownloadExport downloads the content of a dependency list export (SBOM).
type ExportOutput ¶
type ExportOutput struct {
toolutil.HintableOutput
ID int64 `json:"id"`
HasFinished bool `json:"has_finished"`
Self string `json:"self"`
Download string `json:"download"`
}
ExportOutput represents a dependency list export.
func CreateExport ¶
func CreateExport(ctx context.Context, client *gitlabclient.Client, input CreateExportInput) (ExportOutput, error)
CreateExport creates a dependency list export for a pipeline.
func GetExport ¶
func GetExport(ctx context.Context, client *gitlabclient.Client, input GetExportInput) (ExportOutput, error)
GetExport checks the status of a dependency list export.
type GetExportInput ¶
type GetExportInput struct {
ExportID int64 `json:"export_id" jsonschema:"Dependency list export ID,required"`
}
GetExportInput defines parameters for checking a dependency list export status.
type LicenseOutput ¶
LicenseOutput represents a license of a dependency.
type ListInput ¶
type ListInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
PackageManager string `` /* 171-byte string literal not displayed */
toolutil.PaginationInput
}
ListInput defines parameters for listing project dependencies.
type ListOutput ¶
type ListOutput struct {
toolutil.HintableOutput
Dependencies []Output `json:"dependencies"`
Pagination toolutil.PaginationOutput `json:"pagination"`
}
ListOutput holds a paginated list of dependencies.
func ListDeps ¶
func ListDeps(ctx context.Context, client *gitlabclient.Client, input ListInput) (ListOutput, error)
ListDeps lists dependencies for a project.
type Output ¶
type Output struct {
Name string `json:"name"`
Version string `json:"version"`
PackageManager string `json:"package_manager"`
DependencyFilePath string `json:"dependency_file_path"`
Vulnerabilities []VulnerabilityOutput `json:"vulnerabilities,omitempty"`
Licenses []LicenseOutput `json:"licenses,omitempty"`
}
Output represents a single project dependency.