Documentation
¶
Overview ¶
Package snippetnotes implements GitLab snippet note (comment) operations including list, get, create, update, and delete. Notes are comments attached to project snippets and may be system-generated or user-created.
Index ¶
- func Delete(ctx context.Context, client *gitlabclient.Client, input DeleteInput) error
- func FormatListMarkdown(out ListOutput) string
- func FormatOutputMarkdown(n Output) string
- func RegisterTools(server *mcp.Server, client *gitlabclient.Client)
- type CreateInput
- type DeleteInput
- type GetInput
- type ListInput
- type ListOutput
- type Output
- type UpdateInput
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 note from a snippet.
func FormatListMarkdown ¶
func FormatListMarkdown(out ListOutput) string
FormatListMarkdown renders a list of snippet notes as a Markdown table.
func FormatOutputMarkdown ¶
FormatOutputMarkdown renders a single snippet note as a Markdown summary.
func RegisterTools ¶
func RegisterTools(server *mcp.Server, client *gitlabclient.Client)
RegisterTools registers MCP tools for GitLab snippet note operations.
Types ¶
type CreateInput ¶
type CreateInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
SnippetID int64 `json:"snippet_id" jsonschema:"Snippet ID,required"`
Body string `json:"body" jsonschema:"Note body (Markdown supported),required"`
}
CreateInput defines parameters for creating a note on a snippet.
type DeleteInput ¶
type DeleteInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
SnippetID int64 `json:"snippet_id" jsonschema:"Snippet ID,required"`
NoteID int64 `json:"note_id" jsonschema:"ID of the note to delete,required"`
}
DeleteInput defines parameters for deleting a snippet note.
type GetInput ¶
type GetInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
SnippetID int64 `json:"snippet_id" jsonschema:"Snippet ID,required"`
NoteID int64 `json:"note_id" jsonschema:"ID of the note to retrieve,required"`
}
GetInput defines parameters for getting a single snippet note.
type ListInput ¶
type ListInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
SnippetID int64 `json:"snippet_id" jsonschema:"Snippet ID,required"`
OrderBy string `json:"order_by,omitempty" jsonschema:"Order by field (created_at, updated_at)"`
Sort string `json:"sort,omitempty" jsonschema:"Sort direction (asc, desc)"`
toolutil.PaginationInput
}
ListInput defines parameters for listing snippet notes.
type ListOutput ¶
type ListOutput struct {
toolutil.HintableOutput
Notes []Output `json:"notes"`
Pagination toolutil.PaginationOutput `json:"pagination"`
}
ListOutput holds a paginated list of snippet notes.
func List ¶
func List(ctx context.Context, client *gitlabclient.Client, input ListInput) (ListOutput, error)
List retrieves a paginated list of notes on a snippet.
type Output ¶
type Output struct {
toolutil.HintableOutput
ID int64 `json:"id"`
Body string `json:"body"`
Author string `json:"author"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at,omitempty"`
System bool `json:"system"`
NoteableType string `json:"notable_type,omitempty"`
NoteableID int64 `json:"notable_id,omitempty"`
}
Output represents a note (comment) on a snippet.
func Create ¶
func Create(ctx context.Context, client *gitlabclient.Client, input CreateInput) (Output, error)
Create adds a new note to a snippet.
func Update ¶
func Update(ctx context.Context, client *gitlabclient.Client, input UpdateInput) (Output, error)
Update modifies the body of an existing snippet note.
type UpdateInput ¶
type UpdateInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
SnippetID int64 `json:"snippet_id" jsonschema:"Snippet ID,required"`
NoteID int64 `json:"note_id" jsonschema:"ID of the note to update,required"`
Body string `json:"body" jsonschema:"Updated note body (Markdown supported),required"`
}
UpdateInput defines parameters for updating a snippet note.