Help us shape the future of Go! Take the 2026 Go Developer Survey

snippetnotes

package
v3.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package snippetnotes implements MCP tools for GitLab snippet note operations.

The package wraps the GitLab Notes API for snippet notes:

Index

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

func FormatOutputMarkdown(n Output) string

FormatOutputMarkdown renders a single snippet note as a Markdown summary.

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 an alias of 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.

func Create

func Create(ctx context.Context, client *gitlabclient.Client, input CreateInput) (Output, error)

Create adds a new note to a snippet.

func Get

func Get(ctx context.Context, client *gitlabclient.Client, input GetInput) (Output, error)

Get retrieves a single note on 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.

Jump to

Keyboard shortcuts

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