todos

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package todos implements MCP tool handlers for GitLab to-do item operations including list, mark as done, and mark all as done. It wraps the Todos service from client-go v2.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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

func FormatOutputMarkdownString(t Output) string

FormatOutputMarkdownString formats a single to-do item as Markdown.

func RegisterTools

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

RegisterTools registers all to-do MCP tools on the given server.

Types

type ListInput

type ListInput struct {
	toolutil.PaginationInput
	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 */
}

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

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 Output

type Output struct {
	ID          int64  `json:"id"`
	ActionName  string `json:"action_name"`
	TargetType  string `json:"target_type"`
	TargetTitle string `json:"target_title"`
	TargetURL   string `json:"target_url"`
	Body        string `json:"body,omitempty"`
	State       string `json:"state"`
	ProjectName string `json:"project_name,omitempty"`
	AuthorName  string `json:"author_name,omitempty"`
	CreatedAt   string `json:"created_at,omitempty"`
}

Output represents a single to-do item.

Jump to

Keyboard shortcuts

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