issuelinks

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: 9 Imported by: 0

Documentation

Overview

Package issuelinks implements MCP tool handlers for GitLab issue link operations including list, get, create, and delete. It manages relationships between issues (relates_to, blocks, is_blocked_by) via the IssueLinks API.

markdown.go provides Markdown formatting functions for issue link MCP tool output.

register.go wires issuelinks 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 deletes resources for the issuelinks package.

func FormatListMarkdown

func FormatListMarkdown(out ListOutput) string

FormatListMarkdown renders a list of issue relations as a Markdown table.

func FormatOutputMarkdown

func FormatOutputMarkdown(v Output) string

FormatOutputMarkdown renders a single issue link as Markdown.

func RegisterTools

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

RegisterTools registers the four issue link management tools with the MCP server.

Types

type CreateInput

type CreateInput struct {
	ProjectID       toolutil.StringOrInt `json:"project_id" jsonschema:"Source project ID or URL-encoded path,required"`
	IssueIID        int                  `json:"issue_iid" jsonschema:"Source issue IID,required"`
	TargetProjectID string               `json:"target_project_id" jsonschema:"Target project ID or path,required"`
	TargetIssueIID  string               `json:"target_issue_iid" jsonschema:"Target issue IID,required"`
	LinkType        string               `json:"link_type" jsonschema:"Link type: relates_to (default), blocks, or is_blocked_by"`
}

CreateInput holds parameters for creating an issue link.

type DeleteInput

type DeleteInput struct {
	ProjectID   toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	IssueIID    int                  `json:"issue_iid" jsonschema:"Issue IID,required"`
	IssueLinkID int                  `json:"issue_link_id" jsonschema:"Issue link ID to remove,required"`
}

DeleteInput holds parameters for deleting an issue link.

type GetInput

type GetInput struct {
	ProjectID   toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	IssueIID    int                  `json:"issue_iid" jsonschema:"Issue IID,required"`
	IssueLinkID int                  `json:"issue_link_id" jsonschema:"Issue link ID,required"`
}

GetInput holds parameters for getting a specific issue link.

type ListInput

type ListInput struct {
	ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	IssueIID  int                  `json:"issue_iid" jsonschema:"Issue IID,required"`
}

ListInput holds parameters for listing issue relations.

type ListOutput

type ListOutput struct {
	toolutil.HintableOutput
	Relations []RelationOutput `json:"relations"`
}

ListOutput represents a list of issue relations.

func List

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

List lists resources for the issuelinks package.

type Output

type Output struct {
	toolutil.HintableOutput
	ID              int    `json:"id"`
	SourceIssueIID  int    `json:"source_issue_iid"`
	SourceProjectID int    `json:"source_project_id"`
	TargetIssueIID  int    `json:"target_issue_iid"`
	TargetProjectID int    `json:"target_project_id"`
	LinkType        string `json:"link_type"`
}

Output represents a single issue link.

func Create

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

Create creates resources for the issuelinks package.

func Get

func Get(ctx context.Context, client *gitlabclient.Client, input GetInput) (Output, error)

Get retrieves resources for the issuelinks package.

type RelationOutput

type RelationOutput struct {
	ID          int    `json:"id"`
	IID         int    `json:"iid"`
	Title       string `json:"title"`
	State       string `json:"state"`
	ProjectID   int    `json:"project_id"`
	LinkType    string `json:"link_type"`
	IssueLinkID int    `json:"issue_link_id"`
	WebURL      string `json:"web_url"`
}

RelationOutput represents a related issue from the list endpoint.

Jump to

Keyboard shortcuts

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