Documentation
¶
Overview ¶
Package issuenotes implements MCP tools for GitLab issue note operations.
The package wraps the GitLab Notes API for issue 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
- func Create(ctx context.Context, client *gitlabclient.Client, input CreateInput) (Output, error)
- func GetNote(ctx context.Context, client *gitlabclient.Client, input GetInput) (Output, error)
- func ToOutput(n *gl.Note) Output
- func Update(ctx context.Context, client *gitlabclient.Client, input UpdateInput) (Output, error)
- 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 issue note actions exposed as MCP tools. The create/list/get/update/delete routes are projected into the dynamic, meta, individual, and audit surfaces by the action catalog (ADR-0004).
func Delete ¶
func Delete(ctx context.Context, client *gitlabclient.Client, input DeleteInput) error
Delete removes an issue note from a GitLab project via the GitLab Notes API (DELETE /projects/:id/issues/:issue_iid/notes/:note_id). Only the note author or a project Maintainer can delete a note; system notes cannot be deleted.
func FormatListMarkdown ¶
func FormatListMarkdown(out ListOutput) string
FormatListMarkdown renders a list of issue notes as a Markdown table.
func FormatOutputMarkdown ¶
FormatOutputMarkdown renders a single issue 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"`
IssueIID int64 `json:"issue_iid" jsonschema:"Issue internal ID,required"`
Body string `json:"body" jsonschema:"Note body (Markdown supported),required"`
Internal *bool `json:"internal,omitempty" jsonschema:"Mark note as internal (visible only to project members)"`
CreatedAt string `` /* 192-byte string literal not displayed */
}
CreateInput defines parameters for adding a comment to an issue.
type DeleteInput ¶
type DeleteInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
IssueIID int64 `json:"issue_iid" jsonschema:"Issue internal ID,required"`
NoteID int64 `json:"note_id" jsonschema:"ID of the note to delete,required"`
}
DeleteInput defines parameters for deleting an issue note.
type GetInput ¶
type GetInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
IssueIID int64 `json:"issue_iid" jsonschema:"Issue internal ID,required"`
NoteID int64 `json:"note_id" jsonschema:"ID of the note to retrieve,required"`
}
GetInput defines parameters for getting a single issue note.
type ListInput ¶
type ListInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
IssueIID int64 `json:"issue_iid" jsonschema:"Issue internal 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 issue notes.
type ListOutput ¶
type ListOutput struct {
toolutil.HintableOutput
Notes []Output `json:"notes"`
Pagination toolutil.PaginationOutput `json:"pagination"`
}
ListOutput holds a paginated list of issue notes.
func List ¶
func List(ctx context.Context, client *gitlabclient.Client, input ListInput) (ListOutput, error)
List retrieves a paginated list of notes for a specific issue. Supports ordering by created_at or updated_at and sorting in ascending or descending order. Returns the notes with pagination metadata.
type Output ¶
type Output = toolutil.NoteOutput
Output is an alias of toolutil.NoteOutput, the canonical REST note shape shared between issuenotes and mrnotes. Field layout and JSON tags are defined in toolutil; see toolutil.NoteOutputFromGitLab for the 1:1 audit conversion logic.
func Create ¶
func Create(ctx context.Context, client *gitlabclient.Client, input CreateInput) (Output, error)
Create adds a new comment to the specified issue in a GitLab project. The note body supports Markdown and can optionally be marked as internal. Returns the created note or an error if the API call fails.
func GetNote ¶
GetNote retrieves a single issue note by note ID from the GitLab Notes API (GET /projects/:id/issues/:issue_iid/notes/:note_id). Returns the note details or an error if the note is not found.
func ToOutput ¶
ToOutput converts a GitLab API gl.Note to the MCP tool Output shape. Delegates to toolutil.NoteOutputFromGitLab which owns the 1:1 audit field mapping and timestamp formatting.
func Update ¶
func Update(ctx context.Context, client *gitlabclient.Client, input UpdateInput) (Output, error)
Update replaces the body of an existing issue note via the GitLab Notes API (PUT /projects/:id/issues/:issue_iid/notes/:note_id). Only the original author can edit a note; system notes cannot be edited.
type UpdateInput ¶
type UpdateInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
IssueIID int64 `json:"issue_iid" jsonschema:"Issue internal 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 an issue note.