mrcontextcommits

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

markdown.go provides Markdown formatting functions for merge request context commit MCP tool output.

Package mrcontextcommits implements MCP tool handlers for managing merge request context commits in GitLab. It wraps the MergeRequestContextCommitsService from client-go v2.

register.go wires mrcontextcommits MCP tools to the MCP server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(ctx context.Context, client *gitlabclient.Client, input DeleteInput) error

Delete removes context commits from a merge request.

func FormatListMarkdown

func FormatListMarkdown(out ListOutput) *mcp.CallToolResult

FormatListMarkdown formats the list of context commits as markdown.

func RegisterTools

func RegisterTools(server *mcp.Server, client *gitlabclient.Client)

RegisterTools registers all MR context commit tools on the MCP server.

Types

type CommitItem

type CommitItem struct {
	ID          string `json:"id"`
	ShortID     string `json:"short_id"`
	Title       string `json:"title"`
	AuthorName  string `json:"author_name"`
	AuthorEmail string `json:"author_email"`
	CreatedAt   string `json:"created_at,omitempty"`
}

CommitItem is a summary of a commit.

type CreateInput

type CreateInput struct {
	ProjectID    toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	MergeRequest int64                `json:"merge_request_iid"     jsonschema:"Merge request IID,required"`
	Commits      []string             `json:"commits"    jsonschema:"List of commit SHAs to add as context,required"`
}

CreateInput is the input for creating MR context commits.

type DeleteInput

type DeleteInput struct {
	ProjectID    toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	MergeRequest int64                `json:"merge_request_iid"     jsonschema:"Merge request IID,required"`
	Commits      []string             `json:"commits"    jsonschema:"List of commit SHAs to remove from context,required"`
}

DeleteInput is the input for deleting MR context commits.

type ListInput

type ListInput struct {
	ProjectID    toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	MergeRequest int64                `json:"merge_request_iid"     jsonschema:"Merge request IID,required"`
}

ListInput is the input for listing MR context commits.

type ListOutput

type ListOutput struct {
	toolutil.HintableOutput
	Commits []CommitItem `json:"commits"`
}

ListOutput is the output for listing MR context commits.

func Create

func Create(ctx context.Context, client *gitlabclient.Client, input CreateInput) (ListOutput, error)

Create adds context commits to a merge request.

func List

func List(ctx context.Context, client *gitlabclient.Client, input ListInput) (ListOutput, error)

List returns the context commits for a merge request.

Jump to

Keyboard shortcuts

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