Documentation
¶
Overview ¶
Package snippetnotes implements MCP tools for GitLab snippet note operations.
The package wraps the GitLab Notes API for snippet notes:
Index ¶
- func ActionSpecs(client *gitlabclient.Client) []toolutil.ActionSpec
- func Delete(ctx context.Context, client *gitlabclient.Client, input DeleteInput) error
- func FormatListMarkdown(out ListOutput) string
- func FormatOutputMarkdown(n Output) string
- 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 ActionSpecs ¶
func ActionSpecs(client *gitlabclient.Client) []toolutil.ActionSpec
ActionSpecs returns canonical specs for project snippet note actions.
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. Its next steps name the canonical action IDs every surface resolves: the card was never served while the note type was shared, so its bare meta action names had reached no reader.
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"`
CreatedAt string `` /* 192-byte string literal not displayed */
}
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
toolutil.KeysetPaginationInput
}
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 toolutil.NoteOutput
Output is a snippet note: a type of its own over toolutil.NoteOutput, the canonical REST note shape shared with issuenotes and mrnotes, every field GitLab's Note entity sends, the author as the UserBasic object it is. Until 2.8.0 this package carried a copy of that shape with `updated_at` omitted when empty. It is a defined type rather than an alias because the Markdown registry is keyed by type: while the three packages aliased one, the issue note formatter rendered every snippet note as an "Issue Note" naming issue actions (issue 1291).
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.