tools

package
v1.19.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2025 License: MIT Imports: 18 Imported by: 0

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

This section is empty.

Variables

View Source
var ErrArgumentType = errors.New("invalid argument type")

ErrArgumentType is an error indicating that the argument provided is of an invalid type.

Functions

This section is empty.

Types

type DiscussionService added in v1.1.0

type DiscussionService struct {
	// contains filtered or unexported fields
}

func NewDiscussionTools added in v1.1.0

func NewDiscussionTools(client *gitlab.Client) *DiscussionService

NewDiscussionTools creates a new instance of DiscussionServiceInterface with the provided GitLab client.

func (*DiscussionService) AddDiscussionNote added in v1.1.0

func (d *DiscussionService) AddDiscussionNote() server.ServerTool

func (*DiscussionService) AddTo added in v1.1.0

func (d *DiscussionService) AddTo(srv *server.MCPServer)

AddTo registers all discussion-related tools with the provided MCPServer.

func (*DiscussionService) DeleteDiscussionNote added in v1.1.0

func (d *DiscussionService) DeleteDiscussionNote() server.ServerTool

func (*DiscussionService) ListDiscussions added in v1.1.0

func (d *DiscussionService) ListDiscussions() server.ServerTool

func (*DiscussionService) ModifyDiscussionNote added in v1.1.0

func (d *DiscussionService) ModifyDiscussionNote() server.ServerTool

func (*DiscussionService) NewDiscussion added in v1.1.0

func (d *DiscussionService) NewDiscussion() server.ServerTool

func (*DiscussionService) NewPositionDiscussion added in v1.1.0

func (d *DiscussionService) NewPositionDiscussion() server.ServerTool

func (*DiscussionService) ResolveDiscussion added in v1.1.0

func (d *DiscussionService) ResolveDiscussion() server.ServerTool

type DiscussionServiceInterface added in v1.1.0

type DiscussionServiceInterface interface {
	// AddTo registers all discussion-related tools with the provided MCPServer.
	AddTo(srv *server.MCPServer)

	// 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 EpicService

type EpicService struct {
	// contains filtered or unexported fields
}

func NewEpicTools

func NewEpicTools(client *gitlab.Client) *EpicService

NewEpicTools creates a new instance of EpicServiceInterface with the provided GitLab client. It returns an implementation that can be used to interact with GitLab's epic API.

func (*EpicService) AddTo

func (e *EpicService) AddTo(srv *server.MCPServer)

AddTo registers all epic-related tools with the provided MCPServer. It adds tools for listing, retrieving, and managing epics and their associated issues.

func (*EpicService) GetEpic

func (e *EpicService) 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 (e *EpicService) 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 (*EpicService) ListEpicIssues

func (e *EpicService) 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 (*EpicService) ListGroupEpics

func (e *EpicService) 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 EpicServiceInterface

type EpicServiceInterface interface {
	// AddTo registers all epic-related tools with the provided MCPServer.
	AddTo(srv *server.MCPServer)

	// 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
}

EpicServiceInterface defines the interface for epic-related GitLab operations. It provides methods for retrieving and listing epics and their associated issues.

type EventsService added in v1.6.0

type EventsService struct {
	// contains filtered or unexported fields
}

func NewEventsTools added in v1.6.0

func NewEventsTools(client *gitlab.Client) *EventsService

func (*EventsService) AddTo added in v1.6.0

func (e *EventsService) AddTo(srv *server.MCPServer)

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 (*EventsService) ListUserEvents added in v1.6.0

func (e *EventsService) ListUserEvents() server.ServerTool

type EventsServiceInterface added in v1.6.0

type EventsServiceInterface interface {
	// AddTo registers all issue-related tools with the provided MCPServer.
	AddTo(srv *server.MCPServer)

	ListUserEvents() server.ServerTool
}

type IssuesService

type IssuesService struct {
	// contains filtered or unexported fields
}

func NewIssuesTools

func NewIssuesTools(client *gitlab.Client, currentUser string) *IssuesService

NewIssuesTools creates a new instance of IssuesServiceInterface with the provided GitLab client and current user. It returns an implementation that can be used to interact with GitLab's issue API.

func (*IssuesService) AddTo

func (i *IssuesService) AddTo(srv *server.MCPServer)

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 (*IssuesService) CreateIssue added in v1.3.0

func (i *IssuesService) CreateIssue() server.ServerTool

CreateIssue returns a ServerTool for creating a new issue. The tool accepts project ID, title, and other optional issue parameters.

func (*IssuesService) EditIssue added in v1.3.0

func (i *IssuesService) 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 (*IssuesService) GetIssue

func (i *IssuesService) 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 (*IssuesService) ListGroupIssues

func (i *IssuesService) 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 (*IssuesService) ListMergeRequestsRelatedToIssue

func (i *IssuesService) 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 (*IssuesService) ListProjectIssues

func (i *IssuesService) 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.

func (*IssuesService) ListUserIssues

func (i *IssuesService) ListUserIssues() server.ServerTool

ListUserIssues returns a ServerTool for listing all issues assigned to a user. The tool accepts optional assignee and state filter parameters.

type IssuesServiceInterface

type IssuesServiceInterface interface {
	// AddTo registers all issue-related tools with the provided MCPServer.
	AddTo(srv *server.MCPServer)

	// 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
}

IssuesServiceInterface defines the interface for issue-related GitLab operations. It provides methods for retrieving and listing issues and related merge requests.

type JobsService added in v1.2.0

type JobsService struct {
	// contains filtered or unexported fields
}

func NewJobsTools added in v1.2.0

func NewJobsTools(client *gitlab.Client) *JobsService

NewJobsTools creates a new instance of JobsServiceInterface with the provided GitLab client. It returns an implementation that can be used to interact with GitLab's jobs API.

func (*JobsService) AddTo added in v1.2.0

func (j *JobsService) AddTo(srv *server.MCPServer)

AddTo registers all job-related tools with the provided MCPServer. It adds tools for listing, retrieving, and managing jobs and their artifacts.

func (*JobsService) DownloadJobArtifactsFile added in v1.2.0

func (j *JobsService) 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 (*JobsService) DownloadJobLog added in v1.2.0

func (j *JobsService) 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 (*JobsService) GetJob added in v1.2.0

func (j *JobsService) 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 (*JobsService) ListDownstreamPipelines added in v1.2.0

func (j *JobsService) 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 (*JobsService) ListPipelineJobs added in v1.2.0

func (j *JobsService) 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 (*JobsService) RetryJob added in v1.2.0

func (j *JobsService) 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 (*JobsService) TriggerManualJob added in v1.2.0

func (j *JobsService) 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 JobsServiceInterface added in v1.2.0

type JobsServiceInterface interface {
	// AddTo registers all job-related tools with the provided MCPServer.
	AddTo(srv *server.MCPServer)

	// 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 MergeRequestsService

type MergeRequestsService struct {
	// contains filtered or unexported fields
}

func NewMergeRequestsTools

func NewMergeRequestsTools(client *gitlab.Client, currentUser string) *MergeRequestsService

NewMergeRequestsTools creates a new instance of MergeRequestsServiceInterface with the provided GitLab client and current user. It returns an implementation that can be used to interact with GitLab's merge request API.

func (*MergeRequestsService) AddTo

func (m *MergeRequestsService) AddTo(srv *server.MCPServer)

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 (*MergeRequestsService) EditMergeRequest added in v1.11.0

func (m *MergeRequestsService) 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 (*MergeRequestsService) GetIssuesClosedOnMerge

func (m *MergeRequestsService) 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 (*MergeRequestsService) GetMergeRequest

func (m *MergeRequestsService) 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 (*MergeRequestsService) GetMergeRequestApprovals

func (m *MergeRequestsService) 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 (*MergeRequestsService) GetMergeRequestCommits

func (m *MergeRequestsService) 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 (*MergeRequestsService) GetMergeRequestDependencies

func (m *MergeRequestsService) 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 (*MergeRequestsService) GetMergeRequestParticipants

func (m *MergeRequestsService) 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 (*MergeRequestsService) GetMergeRequestReviewers

func (m *MergeRequestsService) 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 (*MergeRequestsService) ListDraftNotes added in v1.12.0

func (m *MergeRequestsService) ListDraftNotes() server.ServerTool

ListDraftNotes returns a ServerTool for listing all draft notes for a specific merge request.

func (*MergeRequestsService) ListGroupMergeRequests

func (m *MergeRequestsService) 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 (*MergeRequestsService) ListMergeRequestDiffs

func (m *MergeRequestsService) ListMergeRequestDiffs() server.ServerTool

ListMergeRequestDiffs returns a ServerTool for listing all versions of diffs for a specific merge request.

func (*MergeRequestsService) ListMergeRequestPipelines

func (m *MergeRequestsService) 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 (*MergeRequestsService) ListProjectMergeRequests

func (m *MergeRequestsService) 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 (*MergeRequestsService) ListUserMergeRequests

func (m *MergeRequestsService) 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 MergeRequestsServiceInterface

type MergeRequestsServiceInterface interface {
	// AddTo registers all merge request-related tools with the provided MCPServer.
	AddTo(srv *server.MCPServer)

	// 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
}

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 RepositoryService added in v1.5.0

type RepositoryService struct {
	// contains filtered or unexported fields
}

func NewRepositoryTools added in v1.5.0

func NewRepositoryTools(client *gitlab.Client) *RepositoryService

NewRepositoryTools creates a new instance of RepositoryServiceInterface with the provided GitLab client. It returns an implementation that can be used to interact with GitLab's repository files API.

func (*RepositoryService) AddTo added in v1.5.0

func (r *RepositoryService) AddTo(srv *server.MCPServer)

AddTo registers all repository file-related tools with the provided MCPServer. It adds tools for listing repository tree and retrieving file contents.

func (*RepositoryService) GetRepositoryFileContents added in v1.5.0

func (r *RepositoryService) 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 (*RepositoryService) ListRepositoryDirectory added in v1.5.0

func (r *RepositoryService) 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 RepositoryServiceInterface added in v1.5.0

type RepositoryServiceInterface interface {
	// AddTo registers all repository file-related tools with the provided MCPServer.
	AddTo(srv *server.MCPServer)

	// 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
}

RepositoryServiceInterface defines the interface for repository file-related GitLab operations. It provides methods for accessing and manipulating repository files and contents.

type SnippetsService

type SnippetsService struct {
	// contains filtered or unexported fields
}

func NewSnippetsTools

func NewSnippetsTools(client *gitlab.Client, currentUser string) *SnippetsService

NewSnippetsTools creates a new instance of SnippetsServiceInterface with the provided GitLab client and current user. It returns an implementation that can be used to interact with GitLab's snippet API.

func (*SnippetsService) AddTo

func (s *SnippetsService) AddTo(srv *server.MCPServer)

AddTo registers all snippet-related tools with the provided MCPServer. It adds tools for listing, retrieving, creating, updating, and deleting snippets.

func (*SnippetsService) CreateSnippet

func (s *SnippetsService) CreateSnippet() server.ServerTool

CreateSnippet returns a ServerTool for creating a new snippet. The tool accepts title, file_name, content, visibility, and description parameters.

func (*SnippetsService) DeleteSnippet

func (s *SnippetsService) DeleteSnippet() server.ServerTool

DeleteSnippet returns a ServerTool for deleting a snippet. The tool accepts a snippet ID as a parameter.

func (*SnippetsService) GetSnippet

func (s *SnippetsService) GetSnippet() server.ServerTool

GetSnippet returns a ServerTool for fetching information about a specific snippet. The tool accepts a snippet ID as a parameter.

func (*SnippetsService) GetSnippetContent

func (s *SnippetsService) 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 (*SnippetsService) ListAllSnippets

func (s *SnippetsService) 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 (*SnippetsService) ListUserSnippets

func (s *SnippetsService) ListUserSnippets() server.ServerTool

ListUserSnippets returns a ServerTool for listing snippets owned by the current user.

func (*SnippetsService) UpdateSnippet

func (s *SnippetsService) 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 SnippetsServiceInterface

type SnippetsServiceInterface interface {
	// AddTo registers all snippet-related tools with the provided MCPServer.
	AddTo(srv *server.MCPServer)

	// 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 TodosService added in v1.7.0

type TodosService struct {
	// contains filtered or unexported fields
}

func NewTodosTools added in v1.7.0

func NewTodosTools(client *gitlab.Client) *TodosService

NewTodosTools creates a new instance of TodosServiceInterface with the provided GitLab client.

func (*TodosService) AddTo added in v1.7.0

func (t *TodosService) AddTo(srv *server.MCPServer)

AddTo registers all todo-related tools with the provided MCPServer.

func (*TodosService) CompleteAllTodoItems added in v1.9.0

func (t *TodosService) 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 (*TodosService) CompleteTodoItem added in v1.9.0

func (t *TodosService) 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 (*TodosService) ListUserTodos added in v1.7.0

func (t *TodosService) ListUserTodos() server.ServerTool

ListUserTodos returns a ServerTool for listing all todos for the current user.

type TodosServiceInterface added in v1.7.0

type TodosServiceInterface interface {
	// AddTo registers all todo-related tools with the provided MCPServer.
	AddTo(srv *server.MCPServer)

	// 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 Tools

type Tools struct {
	// Discussions provides access to GitLab discussion-related operations.
	Discussions DiscussionServiceInterface

	// Epics provides access to GitLab epic-related operations.
	Epics EpicServiceInterface

	// Events provides tools to look up events
	Events EventsServiceInterface

	// Issues provides access to GitLab issue-related operations.
	Issues IssuesServiceInterface

	// Jobs provides access to pipeline job-related operations.
	Jobs JobsServiceInterface

	// MergeRequests provides access to GitLab merge request-related operations.
	MergeRequests MergeRequestsServiceInterface

	// Repositories provides access to GitLab repository-related operations.
	Repositories RepositoryServiceInterface

	// Snippets provides access to GitLab snippet-related operations.
	Snippets SnippetsServiceInterface

	// Todos provides access to GitLab todo-related operations.
	Todos TodosServiceInterface

	// Users provides tools for looking up user IDs, a user's activity and status, etc.
	Users UsersServiceInterface
}

Tools is the main entry point for GitLab API tools, providing access to GitLab epics, issues, and merge requests functionality.

func New

func New(client *gitlab.Client, currentUser string) *Tools

New creates a new instance of Tools with the provided GitLab client and current user. It initializes all the service interfaces for epics, issues, and merge requests.

func (*Tools) AddTo

func (s *Tools) AddTo(srv *server.MCPServer)

AddTo registers all GitLab tools with the provided MCPServer. It calls AddTo on all service interfaces to register their respective tools.

type UsersService

type UsersService struct {
	// contains filtered or unexported fields
}

func NewUsersTools

func NewUsersTools(client *gitlab.Client, currentUser string) *UsersService

NewUsersTools creates a new instance of UsersServiceInterface with the provided GitLab client and current user. It returns an implementation that can be used to interact with GitLab's user API.

func (*UsersService) AddTo

func (u *UsersService) AddTo(srv *server.MCPServer)

AddTo registers all user-related tools with the provided MCPServer. It adds tools for retrieving user information, status, activities, and memberships.

func (*UsersService) GetUser

func (u *UsersService) 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 (*UsersService) GetUserStatus

func (u *UsersService) GetUserStatus() server.ServerTool

GetUserStatus returns a ServerTool for fetching a user's status.

func (*UsersService) SetUserStatus

func (u *UsersService) SetUserStatus() server.ServerTool

SetUserStatus returns a ServerTool for setting a user's status.

type UsersServiceInterface

type UsersServiceInterface interface {
	// AddTo registers all user-related tools with the provided MCPServer.
	AddTo(srv *server.MCPServer)

	// 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.

Jump to

Keyboard shortcuts

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