Documentation
¶
Overview ¶
markdown.go provides Markdown formatting functions for topic MCP tool output.
register.go wires topics MCP tools to the MCP server.
Package topics implements MCP tool handlers for GitLab project topics. It wraps the TopicsService from client-go v2.
Index ¶
- func Delete(ctx context.Context, client *gitlabclient.Client, input DeleteInput) error
- func FormatListMarkdown(out ListOutput) *mcp.CallToolResult
- func FormatTopicMarkdown(t TopicItem) *mcp.CallToolResult
- func RegisterTools(server *mcp.Server, client *gitlabclient.Client)
- 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 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.
func RegisterTools ¶
func RegisterTools(server *mcp.Server, client *gitlabclient.Client)
RegisterTools registers all topic tools on the MCP server.
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"`
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 {
Search string `json:"search,omitempty" jsonschema:"Filter topics by search query"`
Page int64 `json:"page,omitempty" jsonschema:"Page number"`
PerPage int64 `json:"per_page,omitempty" jsonschema:"Items per page"`
}
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 all project topics.
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"`
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 `json:"description,omitempty" jsonschema:"New topic description"`
}
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.