snippetnotes

package
v2.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 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 struct {
	toolutil.HintableOutput
	ID           int64                        `json:"id"`
	Body         string                       `json:"body"`
	Author       *toolutil.NoteUserOutput     `json:"author,omitempty"`
	Attachment   string                       `json:"attachment,omitempty"`
	Title        string                       `json:"title,omitempty"`
	FileName     string                       `json:"file_name,omitempty"`
	CreatedAt    string                       `json:"created_at"`
	UpdatedAt    string                       `json:"updated_at,omitempty"`
	ExpiresAt    string                       `json:"expires_at,omitempty"`
	System       bool                         `json:"system"`
	Internal     bool                         `json:"internal"`
	Resolvable   bool                         `json:"resolvable,omitempty"`
	Resolved     bool                         `json:"resolved,omitempty"`
	ResolvedAt   string                       `json:"resolved_at,omitempty"`
	ResolvedBy   *toolutil.NoteUserOutput     `json:"resolved_by,omitempty"`
	Type         string                       `json:"type,omitempty"`
	CommitID     string                       `json:"commit_id,omitempty"`
	Position     *toolutil.NotePositionOutput `json:"position,omitempty"`
	NoteableType string                       `json:"noteable_type,omitempty"`
	NoteableID   int64                        `json:"noteable_id,omitempty"`
	NoteableIID  int64                        `json:"noteable_iid,omitempty"`
	ProjectID    int64                        `json:"project_id,omitempty"`
	Confidential bool                         `json:"confidential"`
}

Output represents a note (comment) on a snippet. Per the 1:1 audit policy it mirrors every field of gl.Note, surfacing the full author / position sub-objects. Per the locked canonical-key convention the full *NoteUserOutput author object is surfaced on the canonical `author` key.

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