Documentation
¶
Overview ¶
Package boards implements MCP tools for GitLab project issue board operations.
The package wraps the GitLab Issue boards API:
Index ¶
- func ActionSpecs(client *gitlabclient.Client) []toolutil.ActionSpec
- func DeleteBoard(ctx context.Context, client *gitlabclient.Client, input DeleteBoardInput) error
- func DeleteBoardList(ctx context.Context, client *gitlabclient.Client, input DeleteBoardListInput) error
- func FormatBoardListMarkdown(out BoardListOutput) string
- func FormatBoardMarkdown(out BoardOutput) string
- func FormatListBoardListsMarkdown(out ListBoardListsOutput) string
- func FormatListBoardsMarkdown(out ListBoardsOutput) string
- type BasicUserOutput
- type BoardListAssigneeOutput
- type BoardListOutput
- func CreateBoardList(ctx context.Context, client *gitlabclient.Client, input CreateBoardListInput) (BoardListOutput, error)
- func GetBoardList(ctx context.Context, client *gitlabclient.Client, input GetBoardListInput) (BoardListOutput, error)
- func UpdateBoardList(ctx context.Context, client *gitlabclient.Client, input UpdateBoardListInput) (BoardListOutput, error)
- type BoardOutput
- func CreateBoard(ctx context.Context, client *gitlabclient.Client, input CreateBoardInput) (BoardOutput, error)
- func GetBoard(ctx context.Context, client *gitlabclient.Client, input GetBoardInput) (BoardOutput, error)
- func UpdateBoard(ctx context.Context, client *gitlabclient.Client, input UpdateBoardInput) (BoardOutput, error)
- type CreateBoardInput
- type CreateBoardListInput
- type DeleteBoardInput
- type DeleteBoardListInput
- type GetBoardInput
- type GetBoardListInput
- type IterationOutput
- type LabelDetailsOutput
- type LabelOutput
- type ListBoardListsInput
- type ListBoardListsOutput
- type ListBoardsInput
- type ListBoardsOutput
- type MilestoneOutput
- type ProjectOutput
- type UpdateBoardInput
- type UpdateBoardListInput
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 project issue board actions.
func DeleteBoard ¶
func DeleteBoard(ctx context.Context, client *gitlabclient.Client, input DeleteBoardInput) error
DeleteBoard deletes an issue board.
func DeleteBoardList ¶
func DeleteBoardList(ctx context.Context, client *gitlabclient.Client, input DeleteBoardListInput) error
DeleteBoardList deletes a board list.
func FormatBoardListMarkdown ¶
func FormatBoardListMarkdown(out BoardListOutput) string
FormatBoardListMarkdown renders one board column as the card of one object.
func FormatBoardMarkdown ¶
func FormatBoardMarkdown(out BoardOutput) string
FormatBoardMarkdown renders one issue board as the card of one object: the identity, the scope GitLab filters the board by, the two column-visibility flags, and the board's own columns as a nested table.
Every field used to be written as a bullet-less "**Label**: value" line with the value interpolated raw, so consecutive fields ran together into one paragraph and a board named across two lines added headings and list items of its own. The board's ID was nowhere on the card at all, which left the reader nothing to pass back to board_update or board_delete.
func FormatListBoardListsMarkdown ¶
func FormatListBoardListsMarkdown(out ListBoardListsOutput) string
FormatListBoardListsMarkdown renders a page of board columns as a Markdown table.
func FormatListBoardsMarkdown ¶
func FormatListBoardsMarkdown(out ListBoardsOutput) string
FormatListBoardsMarkdown renders a page of issue boards as a Markdown table: a collection of objects that share columns.
Types ¶
type BasicUserOutput ¶
type BasicUserOutput = toolutil.BoardUserOutput
BasicUserOutput is a documented reference subset per doc/api/boards.md. The board's `assignee` object surfaces only the fields the documented update-board response lists (id, name, username, state, avatar_url, web_url); gl.BasicUser's created_at is not part of the documented board assignee shape. Canonical shape shared via toolutil.
type BoardListAssigneeOutput ¶
type BoardListAssigneeOutput = toolutil.BoardListAssigneeOutput
BoardListAssigneeOutput is a documented reference subset per doc/api/boards.md. A board list's `assignee` object (Premium/Ultimate assignee list type) is surfaced with id, name, and username, matching the compact gl.BoardListAssignee struct. Canonical shape shared via toolutil.
type BoardListOutput ¶
type BoardListOutput struct {
toolutil.HintableOutput
ID int64 `json:"id"`
Label *LabelOutput `json:"label,omitempty"`
Assignee *BoardListAssigneeOutput `json:"assignee,omitempty" tier:"premium"`
Milestone *MilestoneOutput `json:"milestone,omitempty" tier:"premium"`
Iteration *IterationOutput `json:"iteration,omitempty" tier:"premium"`
Position int64 `json:"position"`
// MaxIssueCount, MaxIssueWeight and LimitMetric are the list's
// work-in-progress limits, which ee/lib/ee/api/entities/list.rb exposes
// only where they are available (the board parent's wip_limits licensed
// feature, Premium), so a Free schema does not advertise them.
MaxIssueCount int64 `json:"max_issue_count,omitempty" tier:"premium"`
MaxIssueWeight int64 `json:"max_issue_weight,omitempty" tier:"premium"`
// LimitMetric is what the list's work-in-progress limit is counted by
// (all_metrics, issue_count or issue_weights, or null), which GitLab sends
// on every list where those limits are available, null on a list with no
// limit. client-go's BoardList does not model it, so every handler reads
// it off the captured answer beside the SDK's decode (ADR-0021,
// toolutil.BoardListExtra).
LimitMetric string `json:"limit_metric,omitempty" tier:"premium"`
}
BoardListOutput represents a single list within a board. Sub-objects (label, assignee, milestone, iteration) mirror the client-go gl.BoardList struct on their canonical json keys (1:1 audit policy: full nested objects).
func CreateBoardList ¶
func CreateBoardList(ctx context.Context, client *gitlabclient.Client, input CreateBoardListInput) (BoardListOutput, error)
CreateBoardList creates a new board list.
func GetBoardList ¶
func GetBoardList(ctx context.Context, client *gitlabclient.Client, input GetBoardListInput) (BoardListOutput, error)
GetBoardList retrieves a single board list.
func UpdateBoardList ¶
func UpdateBoardList(ctx context.Context, client *gitlabclient.Client, input UpdateBoardListInput) (BoardListOutput, error)
UpdateBoardList reorders a board list.
type BoardOutput ¶
type BoardOutput struct {
toolutil.HintableOutput
ID int64 `json:"id"`
Name string `json:"name"`
Project *ProjectOutput `json:"project,omitempty"`
Milestone *MilestoneOutput `json:"milestone,omitempty" tier:"premium"`
Assignee *BasicUserOutput `json:"assignee,omitempty" tier:"premium"`
Weight *int64 `json:"weight,omitempty" tier:"premium"`
Labels []*LabelDetailsOutput `json:"labels,omitempty"`
HideBacklogList bool `json:"hide_backlog_list"`
HideClosedList bool `json:"hide_closed_list"`
Lists []BoardListOutput `json:"lists,omitempty"`
// Group is the group reference GitLab renders on a board, null on one that
// belongs to a project.
Group *toolutil.BasicGroupDetailsOutput `json:"group,omitempty"`
}
BoardOutput represents a GitLab issue board. Sub-objects (project, milestone, assignee, labels, lists) mirror the client-go gl.IssueBoard struct field for field on their canonical json keys (1:1 audit policy: full nested objects).
func CreateBoard ¶
func CreateBoard(ctx context.Context, client *gitlabclient.Client, input CreateBoardInput) (BoardOutput, error)
CreateBoard creates a new issue board.
func GetBoard ¶
func GetBoard(ctx context.Context, client *gitlabclient.Client, input GetBoardInput) (BoardOutput, error)
GetBoard retrieves a single issue board.
func UpdateBoard ¶
func UpdateBoard(ctx context.Context, client *gitlabclient.Client, input UpdateBoardInput) (BoardOutput, error)
UpdateBoard updates an existing issue board.
type CreateBoardInput ¶
type CreateBoardInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or path,required"`
Name string `json:"name" jsonschema:"Board name,required"`
}
CreateBoardInput represents input for creating a board.
type CreateBoardListInput ¶
type CreateBoardListInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or path,required"`
BoardID int64 `json:"board_id" jsonschema:"Board ID,required"`
LabelID int64 `json:"label_id,omitempty" jsonschema:"Label ID to create a label list"`
AssigneeID int64 `json:"assignee_id,omitempty" tier:"premium" jsonschema:"User ID to create an assignee list"`
MilestoneID int64 `json:"milestone_id,omitempty" tier:"premium" jsonschema:"Milestone ID to create a milestone list"`
IterationID int64 `json:"iteration_id,omitempty" tier:"premium" jsonschema:"Iteration ID to create an iteration list"`
}
CreateBoardListInput represents input for creating a board list. The assignee, milestone and iteration list types are tagged Premium because doc/api/boards.md marks them "Premium and Ultimate only": a Free instance creates a label list from label_id and refuses the other three.
type DeleteBoardInput ¶
type DeleteBoardInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or path,required"`
BoardID int64 `json:"board_id" jsonschema:"Board ID,required"`
}
DeleteBoardInput represents input for deleting a board.
type DeleteBoardListInput ¶
type DeleteBoardListInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or path,required"`
BoardID int64 `json:"board_id" jsonschema:"Board ID,required"`
ListID int64 `json:"list_id" jsonschema:"Board list ID,required"`
}
DeleteBoardListInput represents input for deleting a board list.
type GetBoardInput ¶
type GetBoardInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or path,required"`
BoardID int64 `json:"board_id" jsonschema:"Board ID,required"`
}
GetBoardInput represents input for getting a single board.
type GetBoardListInput ¶
type GetBoardListInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or path,required"`
BoardID int64 `json:"board_id" jsonschema:"Board ID,required"`
ListID int64 `json:"list_id" jsonschema:"Board list ID,required"`
}
GetBoardListInput represents input for getting a single board list.
type IterationOutput ¶
type IterationOutput = toolutil.IterationOutput
IterationOutput is a documented reference subset per doc/api/boards.md. A board list's `iteration` object (Premium/Ultimate iteration list type) mirrors gl.ProjectIteration. Canonical shape shared via toolutil.
type LabelDetailsOutput ¶
type LabelDetailsOutput = toolutil.BoardLabelDetailsOutput
LabelDetailsOutput is a documented reference subset per doc/api/boards.md. The board's `labels[]` entries in the documented update-board response show only id, name, color, and description. Canonical shape shared via toolutil.
type LabelOutput ¶
type LabelOutput = toolutil.BoardLabelOutput
LabelOutput is a documented reference subset per doc/api/boards.md. Every documented board-list response shows the list's `label` object with only name, color, and description. Canonical shape shared via toolutil.
type ListBoardListsInput ¶
type ListBoardListsInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or path,required"`
BoardID int64 `json:"board_id" jsonschema:"Board ID,required"`
OrderBy string `json:"order_by,omitempty" jsonschema:"Column to order results by for keyset pagination (e.g. id, created_at, updated_at)"`
Sort string `json:"sort,omitempty" jsonschema:"Sort direction (asc, desc)"`
toolutil.PaginationInput
toolutil.KeysetPaginationInput
}
ListBoardListsInput represents input for listing board lists. OrderBy/Sort/pagination/page_token map onto the embedded gl.ListOptions to mirror the SDK's keyset-capable list options.
type ListBoardListsOutput ¶
type ListBoardListsOutput struct {
toolutil.HintableOutput
Lists []BoardListOutput `json:"lists"`
Pagination toolutil.PaginationOutput `json:"pagination"`
}
ListBoardListsOutput represents a paginated list of board lists.
func ListBoardLists ¶
func ListBoardLists(ctx context.Context, client *gitlabclient.Client, input ListBoardListsInput) (ListBoardListsOutput, error)
ListBoardLists lists all lists in a board.
type ListBoardsInput ¶
type ListBoardsInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or path,required"`
OrderBy string `json:"order_by,omitempty" jsonschema:"Column to order results by for keyset pagination (e.g. id, created_at, updated_at)"`
Sort string `json:"sort,omitempty" jsonschema:"Sort direction (asc, desc)"`
toolutil.PaginationInput
toolutil.KeysetPaginationInput
}
ListBoardsInput represents input for listing project issue boards. OrderBy/Sort/pagination/page_token map onto the embedded gl.ListOptions to mirror the SDK's keyset-capable list options.
type ListBoardsOutput ¶
type ListBoardsOutput struct {
toolutil.HintableOutput
Boards []BoardOutput `json:"boards"`
Pagination toolutil.PaginationOutput `json:"pagination"`
}
ListBoardsOutput represents a paginated list of boards.
func ListBoards ¶
func ListBoards(ctx context.Context, client *gitlabclient.Client, input ListBoardsInput) (ListBoardsOutput, error)
ListBoards lists all issue boards for a project.
type MilestoneOutput ¶
type MilestoneOutput struct {
ID int64 `json:"id"`
IID int64 `json:"iid"`
ProjectID int64 `json:"project_id"`
Title string `json:"title"`
Description string `json:"description"`
State string `json:"state"`
WebURL string `json:"web_url"`
StartDate string `json:"start_date,omitempty"`
DueDate string `json:"due_date,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
UpdatedAt string `json:"updated_at,omitempty"`
}
MilestoneOutput is a documented reference subset per doc/api/boards.md. The board/list `milestone` object surfaces only the fields the documented update-board response lists (id, iid, project_id, title, description, state, timestamps, dates, web_url); gl.Milestone's group_id and expired are not part of the documented board milestone shape.
type ProjectOutput ¶
type ProjectOutput struct {
ID int64 `json:"id"`
Name string `json:"name,omitempty"`
NameWithNamespace string `json:"name_with_namespace,omitempty"`
Path string `json:"path,omitempty"`
PathWithNamespace string `json:"path_with_namespace,omitempty"`
HTTPURLToRepo string `json:"http_url_to_repo,omitempty"`
WebURL string `json:"web_url,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
DefaultBranch string `json:"default_branch,omitempty"`
TagList []string `json:"tag_list,omitempty"`
Topics []string `json:"topics,omitempty"`
SSHURLToRepo string `json:"ssh_url_to_repo,omitempty"`
ReadmeURL string `json:"readme_url,omitempty"`
AvatarURL string `json:"avatar_url,omitempty"`
StarCount int64 `json:"star_count,omitempty"`
ForksCount int64 `json:"forks_count,omitempty"`
LastActivityAt string `json:"last_activity_at,omitempty"`
}
ProjectOutput is a documented reference subset per doc/api/boards.md. The boards API embeds a project reference on the board's `project` key that contains only the fields the documented response examples list (identity, repo URLs, and the extended fields shown in the update example) — not the full gl.Project payload.
type UpdateBoardInput ¶
type UpdateBoardInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or path,required"`
BoardID int64 `json:"board_id" jsonschema:"Board ID,required"`
Name string `json:"name,omitempty" jsonschema:"Board name"`
AssigneeID *int64 `` /* 187-byte string literal not displayed */
MilestoneID *int64 `` /* 253-byte string literal not displayed */
Labels []string `` /* 170-byte string literal not displayed */
Weight *int64 `json:"weight,omitempty" tier:"premium" jsonschema:"Weight from 0 to 9 the board is scoped to"`
HideBacklogList *bool `json:"hide_backlog_list,omitempty" jsonschema:"Hide the Open list"`
HideClosedList *bool `json:"hide_closed_list,omitempty" jsonschema:"Hide the Closed list"`
}
UpdateBoardInput represents input for updating a board. The four scope fields are tagged Premium because doc/api/boards.md marks them "Premium and Ultimate only": a Free instance updates the board and leaves the scope out, so the Free schema does not offer them. Weight is a pointer because 0 is a scope of its own: GitLab reads only nil and -1 as no weight scope (EMPTY_SCOPE_STATE in ee/app/models/ee/board.rb), and an issue created on a board scoped to 0 gets weight 0. MilestoneID is a pointer for the same reason: 0 is the predefined No Milestone scope and -1 the empty one (Timebox::None and Timebox::Any). AssigneeID is a pointer because GitLab looks the assignee up by its ID and clears the scope when no user has it, which 0 never matches (issue 1306).
type UpdateBoardListInput ¶
type UpdateBoardListInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or path,required"`
BoardID int64 `json:"board_id" jsonschema:"Board ID,required"`
ListID int64 `json:"list_id" jsonschema:"Board list ID,required"`
Position int64 `json:"position" jsonschema:"New position of the list,required"`
}
UpdateBoardListInput represents input for updating (reordering) a board list.