Documentation
¶
Overview ¶
Package tools provides a set of GitLab API tools for interacting with GitLab resources such as epics, issues, and merge requests. This package wraps the GitLab client-go library and exposes its functionality through a structured MCP (Machine Conversation Protocol) interface.
The tools package enables applications to query and manipulate GitLab resources through a unified API. It handles pagination automatically and provides convenient access to GitLab's epics, issues, and merge requests endpoints. All results are returned as JSON for easy integration with other systems.
Index ¶
- Constants
- Variables
- func AddTo(srv ToolAdder)
- func ClientHandler[A any](...) server.ToolHandlerFunc
- func ClientUserHandler[A any](...) server.ToolHandlerFunc
- type DiscussionServiceInterface
- type DiscussionTools
- func (d *DiscussionTools) AddDiscussionNote() server.ServerTool
- func (d *DiscussionTools) AddTo(srv ToolAdder)
- func (d *DiscussionTools) DeleteDiscussionNote() server.ServerTool
- func (d *DiscussionTools) ListDiscussions() server.ServerTool
- func (d *DiscussionTools) ModifyDiscussionNote() server.ServerTool
- func (d *DiscussionTools) NewDiscussion() server.ServerTool
- func (d *DiscussionTools) NewPositionDiscussion() server.ServerTool
- func (d *DiscussionTools) ResolveDiscussion() server.ServerTool
- type EpicServiceInterface
- type EpicTools
- func (e *EpicTools) AddTo(srv ToolAdder)
- func (e *EpicTools) CreateEpic() server.ServerTool
- func (e *EpicTools) EditEpic() server.ServerTool
- func (e *EpicTools) GetEpic() server.ServerTool
- func (e *EpicTools) GetEpicLinks() server.ServerTool
- func (e *EpicTools) ListEpicIssues() server.ServerTool
- func (e *EpicTools) ListGroupEpics() server.ServerTool
- type EventsServiceInterface
- type EventsTools
- type GroupsTools
- type IssuesServiceInterface
- type IssuesTools
- func (i *IssuesTools) AddTo(srv ToolAdder)
- func (i *IssuesTools) CreateIssue() server.ServerTool
- func (i *IssuesTools) EditIssue() server.ServerTool
- func (i *IssuesTools) GetIssue() server.ServerTool
- func (i *IssuesTools) IssueTimeTracking() server.ServerTool
- func (i *IssuesTools) ListGroupIssues() server.ServerTool
- func (i *IssuesTools) ListIssues() server.ServerTool
- func (i *IssuesTools) ListMergeRequestsRelatedToIssue() server.ServerTool
- func (i *IssuesTools) ListProjectIssues() server.ServerTool
- type JobsServiceInterface
- type JobsTools
- func (j *JobsTools) AddTo(srv ToolAdder)
- func (j *JobsTools) DownloadJobArtifactsFile() server.ServerTool
- func (j *JobsTools) DownloadJobLog() server.ServerTool
- func (j *JobsTools) GetJob() server.ServerTool
- func (j *JobsTools) ListDownstreamPipelines() server.ServerTool
- func (j *JobsTools) ListPipelineJobs() server.ServerTool
- func (j *JobsTools) RetryJob() server.ServerTool
- func (j *JobsTools) TriggerManualJob() server.ServerTool
- type MergeRequestsServiceInterface
- type MergeRequestsTools
- func (m *MergeRequestsTools) AddTo(srv ToolAdder)
- func (m *MergeRequestsTools) CreateMergeRequest() server.ServerTool
- func (m *MergeRequestsTools) EditMergeRequest() server.ServerTool
- func (m *MergeRequestsTools) GetIssuesClosedOnMerge() server.ServerTool
- func (m *MergeRequestsTools) GetMergeRequest() server.ServerTool
- func (m *MergeRequestsTools) GetMergeRequestApprovals() server.ServerTool
- func (m *MergeRequestsTools) GetMergeRequestCommits() server.ServerTool
- func (m *MergeRequestsTools) GetMergeRequestDependencies() server.ServerTool
- func (m *MergeRequestsTools) GetMergeRequestParticipants() server.ServerTool
- func (m *MergeRequestsTools) GetMergeRequestReviewers() server.ServerTool
- func (m *MergeRequestsTools) ListDraftNotes() server.ServerTool
- func (m *MergeRequestsTools) ListGroupMergeRequests() server.ServerTool
- func (m *MergeRequestsTools) ListMergeRequestDiffs() server.ServerTool
- func (m *MergeRequestsTools) ListMergeRequestPipelines() server.ServerTool
- func (m *MergeRequestsTools) ListProjectMergeRequests() server.ServerTool
- func (m *MergeRequestsTools) ListUserMergeRequests() server.ServerTool
- type ProjectsTools
- type RepositoryServiceInterface
- type RepositoryTools
- type SnippetsServiceInterface
- type SnippetsTools
- func (s *SnippetsTools) AddTo(srv ToolAdder)
- func (s *SnippetsTools) CreateSnippet() server.ServerTool
- func (s *SnippetsTools) DeleteSnippet() server.ServerTool
- func (s *SnippetsTools) GetSnippet() server.ServerTool
- func (s *SnippetsTools) GetSnippetContent() server.ServerTool
- func (s *SnippetsTools) ListAllSnippets() server.ServerTool
- func (s *SnippetsTools) ListUserSnippets() server.ServerTool
- func (s *SnippetsTools) UpdateSnippet() server.ServerTool
- type TodosServiceInterface
- type TodosTools
- type ToolAdder
- type UsersServiceInterface
- type UsersTools
Constants ¶
const ( ActionCreate = "create" ActionDelete = "delete" ActionMove = "move" ActionUpdate = "update" )
File action constants.
Variables ¶
var ( ErrInvalidAction = errors.New("invalid action") ErrPreviousPathRequired = errors.New("previous_path is required when action is move") ErrContentsRequired = errors.New("contents is required for action") )
Error variables for static wrapping.
var ErrInvalidArgument = errors.New("invalid argument")
ErrInvalidArgument is an error indicating that the argument provided is invalid.
Functions ¶
func AddTo ¶ added in v1.22.0
func AddTo(srv ToolAdder)
AddTo registers all implemented GitLab tools with the provided MCPServer.
func ClientHandler ¶ added in v1.22.0
func ClientHandler[A any](hndl func(ctx context.Context, client *gitlab.Client, args A, req mcp.CallToolRequest) (*mcp.CallToolResult, error)) server.ToolHandlerFunc
ClientHandler wraps a tool handler function with a GitLab client, initializing the client from the provided context before calling the handler.
func ClientUserHandler ¶ added in v1.22.0
func ClientUserHandler[A any](hndl func(ctx context.Context, client *gitlab.Client, args A, currentUser *gitlab.User, req mcp.CallToolRequest) (*mcp.CallToolResult, error)) server.ToolHandlerFunc
ClientUserHandler wraps a tool handler function with a GitLab client, initializing the client from the provided context before calling the handler.
Types ¶
type DiscussionServiceInterface ¶ added in v1.1.0
type DiscussionServiceInterface interface { // AddTo registers all discussion-related tools with the provided MCPServer. AddTo(srv ToolAdder) // Discussion tools NewDiscussion() server.ServerTool ListDiscussions() server.ServerTool AddDiscussionNote() server.ServerTool ModifyDiscussionNote() server.ServerTool DeleteDiscussionNote() server.ServerTool ResolveDiscussion() server.ServerTool }
DiscussionServiceInterface defines the interface for discussion-related GitLab operations.
type DiscussionTools ¶ added in v1.22.0
type DiscussionTools struct{}
DiscussionTools implements discussion-related MCP tools.
func (*DiscussionTools) AddDiscussionNote ¶ added in v1.22.0
func (d *DiscussionTools) AddDiscussionNote() server.ServerTool
func (*DiscussionTools) AddTo ¶ added in v1.22.0
func (d *DiscussionTools) AddTo(srv ToolAdder)
AddTo registers all discussion-related tools with the provided MCPServer.
func (*DiscussionTools) DeleteDiscussionNote ¶ added in v1.22.0
func (d *DiscussionTools) DeleteDiscussionNote() server.ServerTool
func (*DiscussionTools) ListDiscussions ¶ added in v1.22.0
func (d *DiscussionTools) ListDiscussions() server.ServerTool
func (*DiscussionTools) ModifyDiscussionNote ¶ added in v1.22.0
func (d *DiscussionTools) ModifyDiscussionNote() server.ServerTool
func (*DiscussionTools) NewDiscussion ¶ added in v1.22.0
func (d *DiscussionTools) NewDiscussion() server.ServerTool
func (*DiscussionTools) NewPositionDiscussion ¶ added in v1.22.0
func (d *DiscussionTools) NewPositionDiscussion() server.ServerTool
func (*DiscussionTools) ResolveDiscussion ¶ added in v1.22.0
func (d *DiscussionTools) ResolveDiscussion() server.ServerTool
type EpicServiceInterface ¶
type EpicServiceInterface interface { // AddTo registers all epic-related tools with the provided MCPServer. AddTo(srv ToolAdder) // ListGroupEpics returns a tool for listing all epics in a specific group. ListGroupEpics() server.ServerTool // GetEpic returns a tool for fetching a specific epic by its ID. GetEpic() server.ServerTool // GetEpicLinks returns a tool for fetching all child epics of a specific epic. GetEpicLinks() server.ServerTool // ListEpicIssues returns a tool for listing all issues assigned to a specific epic. ListEpicIssues() server.ServerTool // CreateEpic creates a new epic. CreateEpic() server.ServerTool // EditEpic edits an existing epic. EditEpic() server.ServerTool }
EpicServiceInterface defines the interface for epic-related GitLab operations. It provides methods for retrieving and listing epics and their associated issues.
type EpicTools ¶ added in v1.22.0
type EpicTools struct{}
func (*EpicTools) AddTo ¶ added in v1.22.0
AddTo registers all epic-related tools with the provided MCPServer. It adds tools for listing, retrieving, and managing epics and their associated issues.
func (*EpicTools) CreateEpic ¶ added in v1.27.0
func (e *EpicTools) CreateEpic() server.ServerTool
CreateEpic returns a ServerTool for creating a new epic.
func (*EpicTools) EditEpic ¶ added in v1.28.0
func (e *EpicTools) EditEpic() server.ServerTool
EditEpic returns a ServerTool for updating an existing epic.
func (*EpicTools) GetEpic ¶ added in v1.22.0
func (e *EpicTools) GetEpic() server.ServerTool
GetEpic returns a ServerTool for fetching information about a specific epic. The tool accepts a group ID and an epic internal ID as parameters.
func (*EpicTools) GetEpicLinks ¶ added in v1.22.0
func (e *EpicTools) GetEpicLinks() server.ServerTool
GetEpicLinks returns a ServerTool for retrieving all child epics of a specific epic. The tool accepts a group ID and an epic internal ID as parameters.
func (*EpicTools) ListEpicIssues ¶ added in v1.22.0
func (e *EpicTools) ListEpicIssues() server.ServerTool
ListEpicIssues returns a ServerTool for listing all issues assigned to a specific epic. The tool accepts a group ID and an epic internal ID as parameters.
func (*EpicTools) ListGroupEpics ¶ added in v1.22.0
func (e *EpicTools) ListGroupEpics() server.ServerTool
ListGroupEpics returns a ServerTool for listing all epics in a specific group. The tool accepts a group ID and optional state filter parameters.
type EventsServiceInterface ¶ added in v1.6.0
type EventsServiceInterface interface { // AddTo registers all user events related tools with the provided MCPServer. AddTo(srv ToolAdder) ListUserEvents() server.ServerTool }
type EventsTools ¶ added in v1.22.0
type EventsTools struct{}
EventsTools implements user events related MCP tools.
func (*EventsTools) AddTo ¶ added in v1.22.0
func (e *EventsTools) AddTo(srv ToolAdder)
AddTo registers all user events related tools with the provided MCPServer. It adds tools for listing, retrieving, and managing issues and their related merge requests.
func (*EventsTools) ListUserEvents ¶ added in v1.22.0
func (e *EventsTools) ListUserEvents() server.ServerTool
type GroupsTools ¶ added in v1.29.0
type GroupsTools struct{}
func (*GroupsTools) AddTo ¶ added in v1.29.0
func (g *GroupsTools) AddTo(srv ToolAdder)
AddTo registers all group-related tools with the provided MCPServer.
func (*GroupsTools) GetGroup ¶ added in v1.29.0
func (g *GroupsTools) GetGroup() server.ServerTool
func (*GroupsTools) ListSubgroups ¶ added in v1.29.0
func (g *GroupsTools) ListSubgroups() server.ServerTool
type IssuesServiceInterface ¶
type IssuesServiceInterface interface { // AddTo registers all issue-related tools with the provided MCPServer. AddTo(srv ToolAdder) // ListUserIssues returns a tool for listing all issues assigned to a user. ListUserIssues() server.ServerTool // ListGroupIssues returns a tool for listing all issues within a specific group. ListGroupIssues() server.ServerTool // ListProjectIssues returns a tool for listing all issues within a specific project. ListProjectIssues() server.ServerTool // GetIssue returns a tool for fetching a specific issue by its ID. GetIssue() server.ServerTool // ListMergeRequestsRelatedToIssue returns a tool for listing all merge requests related to a specific issue. ListMergeRequestsRelatedToIssue() server.ServerTool // CreateIssue returns a tool for creating a new issue in a project. CreateIssue() server.ServerTool // EditIssue returns a tool for updating an existing issue. EditIssue() server.ServerTool // IssueTimeTracking returns a tool for retrieving time tracking information related to issues. IssueTimeTracking() server.ServerTool }
IssuesServiceInterface defines the interface for issue-related GitLab operations. It provides methods for retrieving and listing issues and related merge requests.
type IssuesTools ¶ added in v1.22.0
type IssuesTools struct{}
func (*IssuesTools) AddTo ¶ added in v1.22.0
func (i *IssuesTools) AddTo(srv ToolAdder)
AddTo registers all issue-related tools with the provided MCPServer. It adds tools for listing, retrieving, and managing issues and their related merge requests.
func (*IssuesTools) CreateIssue ¶ added in v1.22.0
func (i *IssuesTools) CreateIssue() server.ServerTool
CreateIssue returns a ServerTool for creating a new issue. The tool accepts project ID, title, and other optional issue parameters.
func (*IssuesTools) EditIssue ¶ added in v1.22.0
func (i *IssuesTools) EditIssue() server.ServerTool
EditIssue returns a ServerTool for updating an existing issue. The tool accepts project ID, issue IID, and other parameters to update the issue.
func (*IssuesTools) GetIssue ¶ added in v1.22.0
func (i *IssuesTools) GetIssue() server.ServerTool
GetIssue returns a ServerTool for fetching a specific issue by its ID, including its discussions. If fetching discussions fails, an error is returned.
func (*IssuesTools) IssueTimeTracking ¶ added in v1.26.0
func (i *IssuesTools) IssueTimeTracking() server.ServerTool
IssueTimeTracking returns a ServerTool for updating time tracking details on an issue.
func (*IssuesTools) ListGroupIssues ¶ added in v1.22.0
func (i *IssuesTools) ListGroupIssues() server.ServerTool
ListGroupIssues returns a ServerTool for listing all issues within a specific group. The tool accepts a group ID and optional filter parameters.
func (*IssuesTools) ListIssues ¶ added in v1.25.0
func (i *IssuesTools) ListIssues() server.ServerTool
ListIssues returns a ServerTool for listing all issues a user has access to.
func (*IssuesTools) ListMergeRequestsRelatedToIssue ¶ added in v1.22.0
func (i *IssuesTools) ListMergeRequestsRelatedToIssue() server.ServerTool
ListMergeRequestsRelatedToIssue returns a ServerTool for listing all merge requests related to a specific issue. The tool accepts a project ID and an issue internal ID as parameters.
func (*IssuesTools) ListProjectIssues ¶ added in v1.22.0
func (i *IssuesTools) ListProjectIssues() server.ServerTool
ListProjectIssues returns a ServerTool for listing all issues within a specific project. The tool accepts a project ID and optional filter parameters.
type JobsServiceInterface ¶ added in v1.2.0
type JobsServiceInterface interface { // AddTo registers all job-related tools with the provided MCPServer. AddTo(srv ToolAdder) // ListPipelineJobs returns a tool for listing all jobs in a specific pipeline. ListPipelineJobs() server.ServerTool // ListDownstreamPipelines returns a tool for listing all downstream pipeline triggers in a specific pipeline. ListDownstreamPipelines() server.ServerTool // GetJob returns a tool for fetching a specific job by its ID. GetJob() server.ServerTool // DownloadJobArtifactsFile returns a tool for downloading a specific artifact file from a job. DownloadJobArtifactsFile() server.ServerTool // DownloadJobLog returns a tool for downloading the log file of a specific job. DownloadJobLog() server.ServerTool // RetryJob returns a tool for retrying a failed job. RetryJob() server.ServerTool // TriggerManualJob returns a tool for manually triggering a job. TriggerManualJob() server.ServerTool }
JobsServiceInterface defines the interface for job-related GitLab operations. It provides methods for retrieving and managing jobs and their artifacts.
type JobsTools ¶ added in v1.22.0
type JobsTools struct{}
JobsTools implements job-related MCP tools.
func (*JobsTools) AddTo ¶ added in v1.22.0
AddTo registers all job-related tools with the provided MCPServer. It adds tools for listing, retrieving, and managing jobs and their artifacts.
func (*JobsTools) DownloadJobArtifactsFile ¶ added in v1.22.0
func (j *JobsTools) DownloadJobArtifactsFile() server.ServerTool
DownloadJobArtifactsFile returns a ServerTool for downloading a specific artifact file from a job. The tool accepts a project ID, job ID, and artifact path as parameters.
func (*JobsTools) DownloadJobLog ¶ added in v1.22.0
func (j *JobsTools) DownloadJobLog() server.ServerTool
DownloadJobLog returns a ServerTool for downloading the log file of a specific job. The tool accepts a project ID and a job ID as parameters.
func (*JobsTools) GetJob ¶ added in v1.22.0
func (j *JobsTools) GetJob() server.ServerTool
GetJob returns a ServerTool for fetching information about a specific job. The tool accepts a project ID and a job ID as parameters.
func (*JobsTools) ListDownstreamPipelines ¶ added in v1.22.0
func (j *JobsTools) ListDownstreamPipelines() server.ServerTool
ListDownstreamPipelines returns a ServerTool for listing all downstream pipeline triggers in a specific pipeline. The tool accepts a project ID, pipeline ID, and optional filter parameters.
func (*JobsTools) ListPipelineJobs ¶ added in v1.22.0
func (j *JobsTools) ListPipelineJobs() server.ServerTool
ListPipelineJobs returns a ServerTool for listing all jobs in a specific pipeline. The tool accepts a project ID, pipeline ID, and optional filter parameters.
func (*JobsTools) RetryJob ¶ added in v1.22.0
func (j *JobsTools) RetryJob() server.ServerTool
RetryJob returns a ServerTool for retrying a failed job. The tool accepts a project ID and a job ID as parameters.
func (*JobsTools) TriggerManualJob ¶ added in v1.22.0
func (j *JobsTools) TriggerManualJob() server.ServerTool
TriggerManualJob returns a ServerTool for manually triggering a job. The tool accepts a project ID, job ID, and optional job variables as parameters.
type MergeRequestsServiceInterface ¶
type MergeRequestsServiceInterface interface { // AddTo registers all merge request-related tools with the provided MCPServer. AddTo(srv ToolAdder) // ListUserMergeRequests returns a tool for listing all merge requests authored by or assigned to a specific user for review. ListUserMergeRequests() server.ServerTool // ListProjectMergeRequests returns a tool for listing all merge requests within a specific project. ListProjectMergeRequests() server.ServerTool // ListGroupMergeRequests returns a tool for listing all merge requests within a specific group. ListGroupMergeRequests() server.ServerTool // GetMergeRequest returns a tool for fetching a specific merge request by its ID. GetMergeRequest() server.ServerTool // GetMergeRequestApprovals returns a tool for fetching approval information for a specific merge request. GetMergeRequestApprovals() server.ServerTool // GetMergeRequestCommits returns a tool for fetching all commits associated with a specific merge request. GetMergeRequestCommits() server.ServerTool // ListMergeRequestDiffs returns a tool for listing diffs of the files changed in a merge request. ListMergeRequestDiffs() server.ServerTool // GetMergeRequestParticipants returns a tool for fetching all participants of a specific merge request. GetMergeRequestParticipants() server.ServerTool // GetMergeRequestReviewers returns a tool for fetching all reviewers of a specific merge request. GetMergeRequestReviewers() server.ServerTool // ListMergeRequestPipelines returns a tool for listing all CI/CD pipelines for a specific merge request. ListMergeRequestPipelines() server.ServerTool // GetIssuesClosedOnMerge returns a tool for fetching all issues that would be closed by merging a specific merge request. GetIssuesClosedOnMerge() server.ServerTool // GetMergeRequestDependencies returns a tool for fetching all dependencies of a specific merge request. GetMergeRequestDependencies() server.ServerTool // EditMergeRequest returns a tool for updating an existing merge request. EditMergeRequest() server.ServerTool // ListDraftNotes returns a tool for fetching draft MR notes. ListDraftNotes() server.ServerTool // CreateMergeRequest returns a tool for creating a new merge request. CreateMergeRequest() server.ServerTool }
MergeRequestsServiceInterface defines the interface for merge request-related GitLab operations. It provides methods for retrieving and listing merge requests and their associated data such as approvals, commits, changes, participants, pipelines, and dependencies.
type MergeRequestsTools ¶ added in v1.22.0
type MergeRequestsTools struct{}
func (*MergeRequestsTools) AddTo ¶ added in v1.22.0
func (m *MergeRequestsTools) AddTo(srv ToolAdder)
AddTo registers all merge request-related tools with the provided MCPServer. It adds tools for listing, retrieving, and managing merge requests and their associated data.
func (*MergeRequestsTools) CreateMergeRequest ¶ added in v1.31.0
func (m *MergeRequestsTools) CreateMergeRequest() server.ServerTool
CreateMergeRequest returns a ServerTool for creating a new merge request. The tool accepts project ID, source branch, title, and various optional parameters.
func (*MergeRequestsTools) EditMergeRequest ¶ added in v1.22.0
func (m *MergeRequestsTools) EditMergeRequest() server.ServerTool
EditMergeRequest returns a ServerTool for updating an existing merge request. The tool can modify various aspects of the merge request including title, description, assignees, reviewers, labels, milestone, target branch, and state.
func (*MergeRequestsTools) GetIssuesClosedOnMerge ¶ added in v1.22.0
func (m *MergeRequestsTools) GetIssuesClosedOnMerge() server.ServerTool
GetIssuesClosedOnMerge returns a ServerTool for fetching all issues that would be closed by merging a specific merge request. The tool accepts a project ID and a merge request internal ID as parameters.
func (*MergeRequestsTools) GetMergeRequest ¶ added in v1.22.0
func (m *MergeRequestsTools) GetMergeRequest() server.ServerTool
GetMergeRequest returns a ServerTool for fetching a specific merge request by its ID, including discussions and diffs. If fetching any part fails, an error is returned. Data is fetched concurrently.
func (*MergeRequestsTools) GetMergeRequestApprovals ¶ added in v1.22.0
func (m *MergeRequestsTools) GetMergeRequestApprovals() server.ServerTool
GetMergeRequestApprovals returns a ServerTool for fetching approval information for a specific merge request. The tool accepts a project ID and a merge request internal ID as parameters.
func (*MergeRequestsTools) GetMergeRequestCommits ¶ added in v1.22.0
func (m *MergeRequestsTools) GetMergeRequestCommits() server.ServerTool
GetMergeRequestCommits returns a ServerTool for fetching all commits associated with a specific merge request. The tool accepts a project ID and a merge request internal ID as parameters.
func (*MergeRequestsTools) GetMergeRequestDependencies ¶ added in v1.22.0
func (m *MergeRequestsTools) GetMergeRequestDependencies() server.ServerTool
GetMergeRequestDependencies returns a ServerTool for fetching all dependencies of a specific merge request. The tool accepts a project ID and a merge request internal ID as parameters.
func (*MergeRequestsTools) GetMergeRequestParticipants ¶ added in v1.22.0
func (m *MergeRequestsTools) GetMergeRequestParticipants() server.ServerTool
GetMergeRequestParticipants returns a ServerTool for fetching all participants of a specific merge request. The tool accepts a project ID and a merge request internal ID as parameters.
func (*MergeRequestsTools) GetMergeRequestReviewers ¶ added in v1.22.0
func (m *MergeRequestsTools) GetMergeRequestReviewers() server.ServerTool
GetMergeRequestReviewers returns a ServerTool for fetching all reviewers of a specific merge request. The tool accepts a project ID and a merge request internal ID as parameters.
func (*MergeRequestsTools) ListDraftNotes ¶ added in v1.22.0
func (m *MergeRequestsTools) ListDraftNotes() server.ServerTool
ListDraftNotes returns a ServerTool for listing all draft notes for a specific merge request.
func (*MergeRequestsTools) ListGroupMergeRequests ¶ added in v1.22.0
func (m *MergeRequestsTools) ListGroupMergeRequests() server.ServerTool
ListGroupMergeRequests returns a ServerTool for listing all merge requests within a specific group. The tool accepts a group ID and optional state filter parameters.
func (*MergeRequestsTools) ListMergeRequestDiffs ¶ added in v1.22.0
func (m *MergeRequestsTools) ListMergeRequestDiffs() server.ServerTool
ListMergeRequestDiffs returns a ServerTool for listing all versions of diffs for a specific merge request.
func (*MergeRequestsTools) ListMergeRequestPipelines ¶ added in v1.22.0
func (m *MergeRequestsTools) ListMergeRequestPipelines() server.ServerTool
ListMergeRequestPipelines returns a ServerTool for listing all CI/CD pipelines for a specific merge request. The tool accepts a project ID and a merge request internal ID as parameters.
func (*MergeRequestsTools) ListProjectMergeRequests ¶ added in v1.22.0
func (m *MergeRequestsTools) ListProjectMergeRequests() server.ServerTool
ListProjectMergeRequests returns a ServerTool for listing all merge requests within a specific project. The tool accepts a project ID and optional state filter parameters.
func (*MergeRequestsTools) ListUserMergeRequests ¶ added in v1.22.0
func (m *MergeRequestsTools) ListUserMergeRequests() server.ServerTool
ListUserMergeRequests returns a ServerTool for listing all merge requests authored by or assigned to a specific user for review. The tool accepts optional username and state filter parameters, as well as a role parameter to determine whether to list merge requests where the user is the author or a reviewer.
type ProjectsTools ¶ added in v1.29.0
type ProjectsTools struct{}
func (*ProjectsTools) AddTo ¶ added in v1.29.0
func (g *ProjectsTools) AddTo(srv ToolAdder)
AddTo registers all project-related tools with the provided MCPServer.
func (*ProjectsTools) ListProjects ¶ added in v1.29.0
func (p *ProjectsTools) ListProjects() server.ServerTool
ListProjects returns an MCP ServerTool for listing projects.
type RepositoryServiceInterface ¶ added in v1.5.0
type RepositoryServiceInterface interface { // AddTo registers all repository file-related tools with the provided MCPServer. AddTo(srv ToolAdder) // ListRepositoryDirectory returns a tool for listing repository files and directories. ListRepositoryDirectory() server.ServerTool // GetRepositoryFileContents returns a tool for retrieving contents of a file either by blob SHA or by file path. GetRepositoryFileContents() server.ServerTool // CreateCommit returns a tool for creating a new commit with file changes. CreateCommit() server.ServerTool }
RepositoryServiceInterface defines the interface for repository file-related GitLab operations. It provides methods for accessing and manipulating repository files and contents.
type RepositoryTools ¶ added in v1.22.0
type RepositoryTools struct{}
RepositoryTools implements the RepositoryServiceInterface and provides tools for listing repository files and retrieving file contents from GitLab.
func (*RepositoryTools) AddTo ¶ added in v1.22.0
func (r *RepositoryTools) AddTo(srv ToolAdder)
AddTo registers all repository file-related tools with the provided MCPServer. It adds tools for listing repository tree and retrieving file contents.
func (*RepositoryTools) CreateCommit ¶ added in v1.31.0
func (r *RepositoryTools) CreateCommit() server.ServerTool
CreateCommit returns a ServerTool for creating a new commit with file changes. The tool accepts project ID, branch, commit message, and file actions.
func (*RepositoryTools) GetRepositoryFileContents ¶ added in v1.22.0
func (r *RepositoryTools) GetRepositoryFileContents() server.ServerTool
GetRepositoryFileContents returns a ServerTool for retrieving the contents of a file. The tool accepts either a blob SHA or a file path with optional reference (branch/tag).
func (*RepositoryTools) ListRepositoryDirectory ¶ added in v1.22.0
func (r *RepositoryTools) ListRepositoryDirectory() server.ServerTool
ListRepositoryDirectory returns a ServerTool for listing repository files and directories. The tool accepts project ID and various optional parameters for customizing the tree listing.
type SnippetsServiceInterface ¶
type SnippetsServiceInterface interface { // AddTo registers all snippet-related tools with the provided MCPServer. AddTo(srv ToolAdder) // ListUserSnippets returns a tool for listing snippets owned by the current user. ListUserSnippets() server.ServerTool // ListAllSnippets returns a tool for listing all snippets the user has access to. ListAllSnippets() server.ServerTool // GetSnippet returns a tool for fetching a specific snippet by its ID. GetSnippet() server.ServerTool // GetSnippetContent returns a tool for fetching the content of a specific snippet. GetSnippetContent() server.ServerTool // CreateSnippet returns a tool for creating a new snippet. CreateSnippet() server.ServerTool // UpdateSnippet returns a tool for updating an existing snippet. UpdateSnippet() server.ServerTool // DeleteSnippet returns a tool for deleting a snippet. DeleteSnippet() server.ServerTool }
SnippetsServiceInterface defines the interface for snippet-related GitLab operations. It provides methods for retrieving, listing, creating, updating, and deleting snippets.
type SnippetsTools ¶ added in v1.22.0
type SnippetsTools struct{}
SnippetsTools implements tools for interacting with GitLab snippets. It provides methods for listing, creating, updating, deleting, and retrieving snippets.
func (*SnippetsTools) AddTo ¶ added in v1.22.0
func (s *SnippetsTools) AddTo(srv ToolAdder)
AddTo registers all snippet-related tools with the provided MCPServer. It adds tools for listing, retrieving, creating, updating, and deleting snippets.
func (*SnippetsTools) CreateSnippet ¶ added in v1.22.0
func (s *SnippetsTools) CreateSnippet() server.ServerTool
CreateSnippet returns a ServerTool for creating a new snippet. The tool accepts title, file_name, content, visibility, and description parameters.
func (*SnippetsTools) DeleteSnippet ¶ added in v1.22.0
func (s *SnippetsTools) DeleteSnippet() server.ServerTool
DeleteSnippet returns a ServerTool for deleting a snippet. The tool accepts a snippet ID as a parameter.
func (*SnippetsTools) GetSnippet ¶ added in v1.22.0
func (s *SnippetsTools) GetSnippet() server.ServerTool
GetSnippet returns a ServerTool for fetching information about a specific snippet. The tool accepts a snippet ID as a parameter.
func (*SnippetsTools) GetSnippetContent ¶ added in v1.22.0
func (s *SnippetsTools) GetSnippetContent() server.ServerTool
GetSnippetContent returns a ServerTool for fetching the content of a specific snippet. The tool accepts a snippet ID as a parameter.
func (*SnippetsTools) ListAllSnippets ¶ added in v1.22.0
func (s *SnippetsTools) ListAllSnippets() server.ServerTool
ListAllSnippets returns a ServerTool for listing all snippets the user has access to. The include_private parameter determines whether to include private snippets or only public ones.
func (*SnippetsTools) ListUserSnippets ¶ added in v1.22.0
func (s *SnippetsTools) ListUserSnippets() server.ServerTool
ListUserSnippets returns a ServerTool for listing snippets owned by the current user.
func (*SnippetsTools) UpdateSnippet ¶ added in v1.22.0
func (s *SnippetsTools) UpdateSnippet() server.ServerTool
UpdateSnippet returns a ServerTool for updating an existing snippet. The tool accepts snippet_id and optional title, file_name, content, visibility, and description parameters.
type TodosServiceInterface ¶ added in v1.7.0
type TodosServiceInterface interface { // AddTo registers all todo-related tools with the provided MCPServer. AddTo(srv ToolAdder) // ListUserTodos returns a tool for listing all todos for the current user. ListUserTodos() server.ServerTool }
TodosServiceInterface defines the interface for todo-related GitLab operations.
type TodosTools ¶ added in v1.22.0
type TodosTools struct{}
TodosTools provides tools to list and manage todos.
func (*TodosTools) AddTo ¶ added in v1.22.0
func (t *TodosTools) AddTo(srv ToolAdder)
AddTo registers all todo-related tools with the provided MCPServer.
func (*TodosTools) CompleteAllTodoItems ¶ added in v1.22.0
func (t *TodosTools) CompleteAllTodoItems() server.ServerTool
CompleteAllTodoItems returns a ServerTool for marking all pending todo items as done. This tool takes no parameters as it affects all pending todo items.
func (*TodosTools) CompleteTodoItem ¶ added in v1.22.0
func (t *TodosTools) CompleteTodoItem() server.ServerTool
CompleteTodoItem returns a ServerTool for marking a single todo item as done. The tool accepts the ID of the todo item to be marked as done.
func (*TodosTools) ListUserTodos ¶ added in v1.22.0
func (t *TodosTools) ListUserTodos() server.ServerTool
ListUserTodos returns a ServerTool for listing all todos for the current user.
type ToolAdder ¶ added in v1.22.0
type ToolAdder interface {
AddTools(tools ...server.ServerTool)
}
ToolAdder defines an interface for adding tools to an MCP server.
type UsersServiceInterface ¶
type UsersServiceInterface interface { // AddTo registers all user-related tools with the provided MCPServer. AddTo(srv ToolAdder) // GetUser returns a tool for fetching information about a specific user or the current user. GetUser() server.ServerTool // GetUserStatus returns a tool for fetching a user's status. GetUserStatus() server.ServerTool // SetUserStatus returns a tool for setting a user's status. SetUserStatus() server.ServerTool }
UsersServiceInterface defines the interface for user-related GitLab operations. It provides methods for retrieving user information, status, activities, and memberships.
type UsersTools ¶ added in v1.22.0
type UsersTools struct{}
UsersTools implements tools for user-related GitLab operations.
func (*UsersTools) AddTo ¶ added in v1.22.0
func (u *UsersTools) AddTo(srv ToolAdder)
AddTo registers all user-related tools with the provided MCPServer. It adds tools for retrieving user information, status, activities, and memberships.
func (*UsersTools) GetUser ¶ added in v1.22.0
func (u *UsersTools) GetUser() server.ServerTool
GetUser returns a ServerTool for fetching information about a specific user or the current user. If no user ID is provided, it returns information about the authenticated user.
func (*UsersTools) GetUserStatus ¶ added in v1.22.0
func (u *UsersTools) GetUserStatus() server.ServerTool
GetUserStatus returns a ServerTool for fetching a user's status.
func (*UsersTools) SetUserStatus ¶ added in v1.22.0
func (u *UsersTools) SetUserStatus() server.ServerTool
SetUserStatus returns a ServerTool for setting a user's status.