Documentation
¶
Overview ¶
Package issuediscussions implements MCP tools for GitLab issue discussion operations.
The package wraps the GitLab Discussions API for issue threads:
Index ¶
- func ActionSpecs(client *gitlabclient.Client) []toolutil.ActionSpec
- func DeleteNote(ctx context.Context, client *gitlabclient.Client, input DeleteNoteInput) error
- func FormatListMarkdownString(out ListOutput) string
- func FormatMarkdownString(out Output) string
- func FormatNoteMarkdownString(out NoteOutput) string
- type AddNoteInput
- type CreateInput
- type DeleteNoteInput
- type GetInput
- type ListInput
- type ListOutput
- type NoteOutput
- type Output
- type UpdateNoteInput
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 discussion actions.
func DeleteNote ¶
func DeleteNote(ctx context.Context, client *gitlabclient.Client, input DeleteNoteInput) error
DeleteNote deletes an issue discussion note.
func FormatListMarkdownString ¶
func FormatListMarkdownString(out ListOutput) string
FormatListMarkdownString renders discussions list as Markdown.
func FormatMarkdownString ¶
FormatMarkdownString renders a discussion as Markdown.
func FormatNoteMarkdownString ¶
func FormatNoteMarkdownString(out NoteOutput) string
FormatNoteMarkdownString renders a note as the shared note card.
Types ¶
type AddNoteInput ¶
type AddNoteInput 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"`
DiscussionID string `json:"discussion_id" jsonschema:"Discussion ID to reply to,required"`
Body string `json:"body" jsonschema:"Note body (Markdown supported),required"`
// CreatedAt backdates the note; requires admin or project/group owner rights (ISO 8601).
CreatedAt string `` /* 142-byte string literal not displayed */
}
AddNoteInput defines parameters for adding a note to an issue discussion.
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:"Discussion body (Markdown supported),required"`
// CreatedAt backdates the discussion's first note; requires admin or project/group owner rights (ISO 8601).
CreatedAt string `` /* 148-byte string literal not displayed */
}
CreateInput defines parameters for creating an issue discussion.
type DeleteNoteInput ¶
type DeleteNoteInput 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"`
DiscussionID string `json:"discussion_id" jsonschema:"Discussion ID,required"`
NoteID int64 `json:"note_id" jsonschema:"Note ID to delete,required"`
}
DeleteNoteInput defines parameters for deleting an issue discussion 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"`
DiscussionID string `json:"discussion_id" jsonschema:"Discussion ID,required"`
}
GetInput defines parameters for getting a single issue discussion.
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 names the column used to order keyset-paginated results.
OrderBy string `json:"order_by,omitempty" jsonschema:"Column to order keyset-paginated results by (e.g. created_at, updated_at)"`
// Sort selects the sort direction for ordered results.
Sort string `json:"sort,omitempty" jsonschema:"Sort direction (asc or desc)"`
toolutil.PaginationInput
toolutil.KeysetPaginationInput
}
ListInput defines parameters for listing issue discussions.
type ListOutput ¶
type ListOutput struct {
toolutil.HintableOutput
Discussions []Output `json:"discussions"`
Pagination toolutil.PaginationOutput `json:"pagination"`
}
ListOutput holds a list of issue discussions.
func List ¶
func List(ctx context.Context, client *gitlabclient.Client, input ListInput) (ListOutput, error)
List lists issue discussions.
type NoteOutput ¶
type NoteOutput toolutil.DiscussionThreadNoteOutput
NoteOutput is a note of an issue discussion: a type of its own over toolutil.DiscussionThreadNoteOutput, the note shape the four REST discussion packages share, every field GitLab's Note entity sends, the author as the UserBasic object it is. Until 2.8.0 this package published a six-field note with the author's username as a string. It is a defined type rather than an alias because the Markdown registry is keyed by type: while the four packages aliased one, the commit discussion card rendered every issue thread and note, offering commit discussion actions as their next steps (issue 1291).
func AddNote ¶
func AddNote(ctx context.Context, client *gitlabclient.Client, input AddNoteInput) (NoteOutput, error)
AddNote adds a note to an existing issue discussion.
func UpdateNote ¶
func UpdateNote(ctx context.Context, client *gitlabclient.Client, input UpdateNoteInput) (NoteOutput, error)
UpdateNote updates an existing issue discussion note.
type Output ¶
type Output toolutil.DiscussionThreadOutput
Output is an issue discussion thread: a type of its own over toolutil.DiscussionThreadOutput, the thread shape with full note payloads and the thread's own resolution state, for the reason NoteOutput gives.
func Create ¶
func Create(ctx context.Context, client *gitlabclient.Client, input CreateInput) (Output, error)
Create creates a new issue discussion thread.
type UpdateNoteInput ¶
type UpdateNoteInput 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"`
DiscussionID string `json:"discussion_id" jsonschema:"Discussion ID,required"`
NoteID int64 `json:"note_id" jsonschema:"Note ID to update,required"`
Body string `json:"body" jsonschema:"Updated note body,required"`
// CreatedAt overrides the note's creation timestamp; requires admin or project/group owner rights (ISO 8601).
CreatedAt string `` /* 142-byte string literal not displayed */
}
UpdateNoteInput defines parameters for updating an issue discussion note.