Documentation
¶
Overview ¶
Package topics implements MCP tools for GitLab project topic operations.
The package wraps the GitLab Topics API:
Index ¶
- func Delete(ctx context.Context, client *gitlabclient.Client, input DeleteInput) error
- func FormatCreateMarkdown(out CreateOutput) *mcp.CallToolResult
- func FormatGetMarkdown(out GetOutput) *mcp.CallToolResult
- func FormatListMarkdown(out ListOutput) *mcp.CallToolResult
- func FormatTopicMarkdown(t TopicItem) *mcp.CallToolResult
- func FormatUpdateMarkdown(out UpdateOutput) *mcp.CallToolResult
- type CreateInput
- type CreateOutput
- type DeleteInput
- type GetInput
- type GetOutput
- type ListInput
- type ListOutput
- type TopicItem
- type UpdateInput
- type UpdateOutput
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 removes a project topic.
func FormatCreateMarkdown ¶
func FormatCreateMarkdown(out CreateOutput) *mcp.CallToolResult
FormatCreateMarkdown formats a single create_topic response.
func FormatGetMarkdown ¶
func FormatGetMarkdown(out GetOutput) *mcp.CallToolResult
FormatGetMarkdown formats a single get_topic response.
func FormatListMarkdown ¶
func FormatListMarkdown(out ListOutput) *mcp.CallToolResult
FormatListMarkdown formats a list of topics.
func FormatTopicMarkdown ¶
func FormatTopicMarkdown(t TopicItem) *mcp.CallToolResult
FormatTopicMarkdown formats a single topic as its card.
func FormatUpdateMarkdown ¶
func FormatUpdateMarkdown(out UpdateOutput) *mcp.CallToolResult
FormatUpdateMarkdown formats a single update_topic response.
Types ¶
type CreateInput ¶
type CreateInput struct {
Name string `json:"name" jsonschema:"Topic name (slug-like unique identifier),required"`
Title string `json:"title,omitempty" jsonschema:"Topic display title,required"`
Description string `json:"description,omitempty" jsonschema:"Topic description"`
}
CreateInput is the input for creating a topic.
type CreateOutput ¶
type CreateOutput struct {
toolutil.HintableOutput
Topic TopicItem `json:"topic"`
}
CreateOutput is the output after creating a topic.
func Create ¶
func Create(ctx context.Context, client *gitlabclient.Client, input CreateInput) (CreateOutput, error)
Create creates a new project topic.
type DeleteInput ¶
type DeleteInput struct {
TopicID int64 `json:"topic_id" jsonschema:"Topic ID,required"`
}
DeleteInput is the input for deleting a topic.
type GetInput ¶
type GetInput struct {
TopicID int64 `json:"topic_id" jsonschema:"Topic ID,required"`
}
GetInput is the input for getting a topic.
type GetOutput ¶
type GetOutput struct {
toolutil.HintableOutput
Topic TopicItem `json:"topic"`
}
GetOutput is the output for getting a topic.
type ListInput ¶
type ListInput struct {
toolutil.PaginationInput
toolutil.KeysetPaginationInput
Search string `json:"search,omitempty" jsonschema:"Filter topics by search query"`
WithoutProjects bool `json:"without_projects,omitempty" jsonschema:"Return only the topics no project is assigned to"`
OrderBy string `json:"order_by,omitempty" jsonschema:"Column to order keyset-paginated results by"`
Sort string `json:"sort,omitempty" jsonschema:"Sort order for keyset-paginated results: 'asc' or 'desc'"`
}
ListInput is the input for listing topics.
type ListOutput ¶
type ListOutput struct {
toolutil.HintableOutput
Topics []TopicItem `json:"topics"`
Pagination toolutil.PaginationOutput `json:"pagination"`
}
ListOutput is the output for listing topics.
func List ¶
func List(ctx context.Context, client *gitlabclient.Client, input ListInput) (ListOutput, error)
List returns the instance's project topics, narrowed to those whose name matches search when one is given, and to the topics no project is assigned to when without_projects is set.
type TopicItem ¶
type TopicItem struct {
ID int64 `json:"id"`
Name string `json:"name"`
Title string `json:"title"`
Description string `json:"description,omitempty"`
TotalProjectsCount uint64 `json:"total_projects_count"`
OrganizationID int64 `json:"organization_id"`
AvatarURL string `json:"avatar_url,omitempty"`
}
TopicItem represents a topic in output.
type UpdateInput ¶
type UpdateInput struct {
TopicID int64 `json:"topic_id" jsonschema:"Topic ID,required"`
Name string `json:"name,omitempty" jsonschema:"New topic name"`
Title string `json:"title,omitempty" jsonschema:"New topic title"`
Description *string `` /* 136-byte string literal not displayed */
}
UpdateInput is the input for updating a topic.
type UpdateOutput ¶
type UpdateOutput struct {
toolutil.HintableOutput
Topic TopicItem `json:"topic"`
}
UpdateOutput is the output after updating a topic.
func Update ¶
func Update(ctx context.Context, client *gitlabclient.Client, input UpdateInput) (UpdateOutput, error)
Update modifies an existing topic.