Documentation
¶
Overview ¶
Package todos implements MCP tools for GitLab todo operations.
The package wraps the GitLab Todos API:
Index ¶
- func ActionSpecs(client *gitlabclient.Client) []toolutil.ActionSpec
- func FormatListMarkdown(v ListOutput) *mcp.CallToolResult
- func FormatListMarkdownString(v ListOutput) string
- func FormatMarkAllDoneMarkdown(v MarkAllDoneOutput) *mcp.CallToolResult
- func FormatMarkAllDoneMarkdownString(v MarkAllDoneOutput) string
- func FormatMarkDoneMarkdown(v MarkDoneOutput) *mcp.CallToolResult
- func FormatMarkDoneMarkdownString(v MarkDoneOutput) string
- func FormatOutputMarkdown(t Output) *mcp.CallToolResult
- func FormatOutputMarkdownString(t Output) string
- type BasicProjectOut
- type BasicUserOut
- type IssueLinksOut
- type ListInput
- type ListOutput
- type MarkAllDoneInput
- type MarkAllDoneOutput
- type MarkDoneInput
- type MarkDoneOutput
- type MilestoneOut
- type Output
- type TaskCompletionStatusOut
- type TimeStatsOut
- type TodoTargetOut
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 todo actions exposed through gitlab_user.
func FormatListMarkdown ¶
func FormatListMarkdown(v ListOutput) *mcp.CallToolResult
FormatListMarkdown returns an MCP tool result for a to-do list.
func FormatListMarkdownString ¶
func FormatListMarkdownString(v ListOutput) string
FormatListMarkdownString formats a list of to-do items as a Markdown table.
func FormatMarkAllDoneMarkdown ¶
func FormatMarkAllDoneMarkdown(v MarkAllDoneOutput) *mcp.CallToolResult
FormatMarkAllDoneMarkdown returns an MCP tool result for marking all to-dos as done.
func FormatMarkAllDoneMarkdownString ¶
func FormatMarkAllDoneMarkdownString(v MarkAllDoneOutput) string
FormatMarkAllDoneMarkdownString formats a mark-all-done result as Markdown.
func FormatMarkDoneMarkdown ¶
func FormatMarkDoneMarkdown(v MarkDoneOutput) *mcp.CallToolResult
FormatMarkDoneMarkdown returns an MCP tool result for marking a to-do as done.
func FormatMarkDoneMarkdownString ¶
func FormatMarkDoneMarkdownString(v MarkDoneOutput) string
FormatMarkDoneMarkdownString formats a mark-done result as Markdown.
func FormatOutputMarkdown ¶
func FormatOutputMarkdown(t Output) *mcp.CallToolResult
FormatOutputMarkdown returns an MCP tool result for a single to-do item.
func FormatOutputMarkdownString ¶
FormatOutputMarkdownString formats a single to-do item as Markdown.
Types ¶
type BasicProjectOut ¶ added in v2.3.0
type BasicProjectOut struct {
ID int64 `json:"id"`
Description string `json:"description"`
Name string `json:"name"`
NameWithNamespace string `json:"name_with_namespace"`
Path string `json:"path"`
PathWithNamespace string `json:"path_with_namespace"`
CreatedAt string `json:"created_at,omitempty"`
}
BasicProjectOut mirrors gl.BasicProject (the project a to-do belongs to).
type BasicUserOut ¶ added in v2.3.0
type BasicUserOut struct {
ID int64 `json:"id"`
Username string `json:"username"`
Name string `json:"name"`
State string `json:"state"`
AvatarURL string `json:"avatar_url"`
WebURL string `json:"web_url"`
CreatedAt string `json:"created_at,omitempty"`
}
BasicUserOut mirrors gl.BasicUser (the to-do author and target user objects).
type IssueLinksOut ¶ added in v2.3.0
type IssueLinksOut struct {
Self string `json:"self"`
Notes string `json:"notes"`
AwardEmoji string `json:"award_emoji"`
Project string `json:"project"`
}
IssueLinksOut mirrors gl.IssueLinks (the _links object on an Issue target).
type ListInput ¶
type ListInput struct {
toolutil.PaginationInput
toolutil.KeysetPaginationInput
Action string `` /* 139-byte string literal not displayed */
AuthorID int64 `json:"author_id,omitempty" jsonschema:"Filter by author user ID"`
ProjectID int64 `json:"project_id,omitempty" jsonschema:"Filter by project ID"`
GroupID int64 `json:"group_id,omitempty" jsonschema:"Filter by group ID"`
State string `json:"state,omitempty" jsonschema:"Filter by state: pending or done (default: pending)"`
Type string `` /* 133-byte string literal not displayed */
OrderBy string `json:"order_by,omitempty" jsonschema:"Order results by field (e.g. id, created_at). Combine with sort."`
Sort string `json:"sort,omitempty" jsonschema:"Sort direction: asc or desc."`
}
ListInput defines parameters for listing to-do items.
type ListOutput ¶
type ListOutput struct {
toolutil.HintableOutput
Todos []Output `json:"todos"`
Pagination toolutil.PaginationOutput `json:"pagination"`
}
ListOutput holds a paginated list of to-do items.
func List ¶
func List(ctx context.Context, client *gitlabclient.Client, input ListInput) (ListOutput, error)
List retrieves to-do items for the authenticated user with optional filters.
type MarkAllDoneInput ¶
type MarkAllDoneInput struct{}
MarkAllDoneInput defines parameters for marking all to-do items as done.
type MarkAllDoneOutput ¶
type MarkAllDoneOutput struct {
toolutil.HintableOutput
Message string `json:"message"`
}
MarkAllDoneOutput represents the result of marking all to-dos as done.
func MarkAllDone ¶
func MarkAllDone(ctx context.Context, client *gitlabclient.Client, _ MarkAllDoneInput) (MarkAllDoneOutput, error)
MarkAllDone marks all pending to-do items as done for the current user.
type MarkDoneInput ¶
type MarkDoneInput struct {
ID int64 `json:"id" jsonschema:"ID of the to-do item to mark as done,required"`
}
MarkDoneInput defines parameters for marking a single to-do item as done.
type MarkDoneOutput ¶
type MarkDoneOutput struct {
toolutil.HintableOutput
ID int64 `json:"id"`
Message string `json:"message"`
}
MarkDoneOutput represents the result of marking a to-do as done.
func MarkDone ¶
func MarkDone(ctx context.Context, client *gitlabclient.Client, input MarkDoneInput) (MarkDoneOutput, error)
MarkDone marks a single pending to-do item as done.
type MilestoneOut ¶ added in v2.3.0
type MilestoneOut struct {
ID int64 `json:"id"`
IID int64 `json:"iid"`
GroupID int64 `json:"group_id"`
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"`
Expired *bool `json:"expired,omitempty"`
}
MilestoneOut mirrors gl.Milestone (the milestone of a to-do's target).
type Output ¶
type Output struct {
ID int64 `json:"id"`
Project *BasicProjectOut `json:"project,omitempty"`
Author *BasicUserOut `json:"author,omitempty"`
ActionName gl.TodoAction `json:"action_name"`
TargetType gl.TodoTargetType `json:"target_type"`
Target *TodoTargetOut `json:"target,omitempty"`
TargetURL string `json:"target_url"`
Body string `json:"body,omitempty"`
State string `json:"state"`
CreatedAt string `json:"created_at,omitempty"`
}
Output represents a single to-do item. It mirrors gl.Todo: action_name and target_type carry the SDK enum types, and the project/author/target sub-objects are surfaced in full per the 1:1 audit policy (no flattened scalar duplicates).
type TaskCompletionStatusOut ¶ added in v2.3.0
type TaskCompletionStatusOut struct {
Count int64 `json:"count"`
CompletedCount int64 `json:"completed_count"`
}
TaskCompletionStatusOut mirrors gl.TasksCompletionStatus.
type TimeStatsOut ¶ added in v2.3.0
type TimeStatsOut struct {
HumanTimeEstimate string `json:"human_time_estimate"`
HumanTotalTimeSpent string `json:"human_total_time_spent"`
TimeEstimate int64 `json:"time_estimate"`
TotalTimeSpent int64 `json:"total_time_spent"`
}
TimeStatsOut mirrors gl.TimeStats (the time_stats object on an Issue target).
type TodoTargetOut ¶ added in v2.3.0
type TodoTargetOut struct {
Assignees []*BasicUserOut `json:"assignees,omitempty"`
Assignee *BasicUserOut `json:"assignee,omitempty"`
Author *BasicUserOut `json:"author,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
Description string `json:"description,omitempty"`
Downvotes int64 `json:"downvotes,omitempty"`
ID any `json:"id,omitempty"`
IID int64 `json:"iid,omitempty"`
Labels []string `json:"labels,omitempty"`
Milestone *MilestoneOut `json:"milestone,omitempty"`
ProjectID int64 `json:"project_id,omitempty"`
State string `json:"state,omitempty"`
Subscribed bool `json:"subscribed,omitempty"`
TaskCompletionStatus *TaskCompletionStatusOut `json:"task_completion_status,omitempty"`
Title string `json:"title,omitempty"`
UpdatedAt string `json:"updated_at,omitempty"`
Upvotes int64 `json:"upvotes,omitempty"`
UserNotesCount int64 `json:"user_notes_count,omitempty"`
WebURL string `json:"web_url,omitempty"`
// Only available for type Issue.
Confidential bool `json:"confidential,omitempty"`
DueDate string `json:"due_date,omitempty"`
HasTasks bool `json:"has_tasks,omitempty"`
Links *IssueLinksOut `json:"_links,omitempty"`
MovedToID int64 `json:"moved_to_id,omitempty"`
TimeStats *TimeStatsOut `json:"time_stats,omitempty"`
Weight int64 `json:"weight,omitempty" tier:"premium"`
// Only available for type MergeRequest.
MergedAt string `json:"merged_at,omitempty"`
ApprovalsBeforeMerge int64 `json:"approvals_before_merge,omitempty"`
ForceRemoveSourceBranch bool `json:"force_remove_source_branch,omitempty"`
MergeCommitSHA string `json:"merge_commit_sha,omitempty"`
MergeWhenPipelineSucceeds bool `json:"merge_when_pipeline_succeeds,omitempty"`
MergeStatus string `json:"merge_status,omitempty"`
Reference string `json:"reference,omitempty"`
Reviewers []*BasicUserOut `json:"reviewers,omitempty"`
SHA string `json:"sha,omitempty"`
ShouldRemoveSourceBranch bool `json:"should_remove_source_branch,omitempty"`
SourceBranch string `json:"source_branch,omitempty"`
SourceProjectID int64 `json:"source_project_id,omitempty"`
Squash bool `json:"squash,omitempty"`
TargetBranch string `json:"target_branch,omitempty"`
TargetProjectID int64 `json:"target_project_id,omitempty"`
WorkInProgress bool `json:"work_in_progress,omitempty"`
// Only available for type DesignManagement::Design.
FileName string `json:"filename,omitempty"`
ImageURL string `json:"image_url,omitempty"`
}
TodoTargetOut mirrors gl.TodoTarget, the issue or merge-request summary that a to-do points at. It surfaces every SDK field, including the type-specific blocks (Issue-only, MergeRequest-only, Design-only) carried by the SDK.