issuelinks

package
v2.2.1 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package issuelinks implements MCP tools for GitLab issue link operations.

The package wraps the GitLab Issue links API:

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActionSpecs

func ActionSpecs(client *gitlabclient.Client) []toolutil.ActionSpec

ActionSpecs returns canonical specs for issue link actions exposed as MCP tools. The list/get/create/delete routes are projected into the dynamic, meta, individual, and audit surfaces by the action catalog (ADR-0004).

func Delete

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

Delete removes an existing issue link from a GitLab project via the GitLab Issue links API (DELETE /projects/:id/issues/:issue_iid/links/:issue_link_id). Returns an error if the link is not found or the caller lacks Reporter role or higher.

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.

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 retrieves the list of issue relations (links) for a given issue from the GitLab Issue links API (GET /projects/:id/issues/:issue_iid/links). Returns a ListOutput with the linked issues or an error if the project or issue is not found.

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 a new issue link between a source issue and a target issue via the GitLab Issue links API (POST /projects/:id/issues/:issue_iid/links). The link may be of type "relates_to" (default), "blocks", or "is_blocked_by" and may target an issue in a different project.

func Get

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

Get retrieves a single issue link by its ID from the GitLab Issue links API (GET /projects/:id/issues/:issue_iid/links/:issue_link_id). Returns the link details including source and target issue metadata.

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