Documentation
¶
Index ¶
- Constants
- Variables
- func GetIssue(getClient GetClientFn) (mcp.Tool, server.ToolHandlerFunc)
- func GetIssueComments(getClient GetClientFn) (tool mcp.Tool, handler server.ToolHandlerFunc)
- func GetIssueLabels(getClient GetClientFn) (tool mcp.Tool, handler server.ToolHandlerFunc)
- func GetMergeRequest(getClient GetClientFn) (tool mcp.Tool, handler server.ToolHandlerFunc)
- func GetMergeRequestComments(getClient GetClientFn) (tool mcp.Tool, handler server.ToolHandlerFunc)
- func GetProject(getClient GetClientFn) (tool mcp.Tool, handler server.ToolHandlerFunc)
- func GetProjectBranches(getClient GetClientFn) (tool mcp.Tool, handler server.ToolHandlerFunc)
- func GetProjectCommits(getClient GetClientFn) (tool mcp.Tool, handler server.ToolHandlerFunc)
- func GetProjectFile(getClient GetClientFn) (tool mcp.Tool, handler server.ToolHandlerFunc)
- func InitToolsets(enabledToolsets []string, readOnly bool, getClient GetClientFn) (*toolsets.ToolsetGroup, error)
- func ListIssues(getClient GetClientFn) (tool mcp.Tool, handler server.ToolHandlerFunc)
- func ListMergeRequests(getClient GetClientFn) (tool mcp.Tool, handler server.ToolHandlerFunc)
- func ListProjectFiles(getClient GetClientFn) (tool mcp.Tool, handler server.ToolHandlerFunc)
- func ListProjects(getClient GetClientFn) (tool mcp.Tool, handler server.ToolHandlerFunc)
- func NewServer(appName, appVersion string) *server.MCPServer
- func OptionalBoolParam(r *mcp.CallToolRequest, p string) (*bool, error)
- func OptionalIntParam(r *mcp.CallToolRequest, p string) (int, error)
- func OptionalIntParamWithDefault(r *mcp.CallToolRequest, p string, defaultValue int) (int, error)
- func OptionalPaginationParams(req *mcp.CallToolRequest) (page, perPage int, err error)
- func OptionalParam[T any](r *mcp.CallToolRequest, p string) (T, error)
- func OptionalParamOK[T any](r *mcp.CallToolRequest, p string) (value T, ok bool, err error)
- func OptionalTimeParam(request *mcp.CallToolRequest, name string) (*time.Time, error)
- func WithPagination() mcp.ToolOption
- type GetClientFn
Constants ¶
const DefaultPerPage = 20
DefaultPerPage defines the default number of items per page for pagination.
const MaxPerPage = 100
MaxPerPage defines the maximum number of items per page allowed by GitLab.
Variables ¶
var DefaultTools = []string{"all"}
DefaultTools defines the list of toolsets enabled by default.
Functions ¶
func GetIssue ¶
func GetIssue(getClient GetClientFn) (mcp.Tool, server.ToolHandlerFunc)
func getIssueTool(getClient GetClientFn, t translations.TranslationHelperFunc) (mcp.Tool, server.ToolHandlerFunc) {
func GetIssueComments ¶
func GetIssueComments(getClient GetClientFn) (tool mcp.Tool, handler server.ToolHandlerFunc)
GetIssueComments defines the MCP tool for retrieving issue comments/notes.
func GetIssueLabels ¶
func GetIssueLabels(getClient GetClientFn) (tool mcp.Tool, handler server.ToolHandlerFunc)
GetIssueLabels defines the MCP tool for retrieving the labels associated with an issue.
func GetMergeRequest ¶
func GetMergeRequest(getClient GetClientFn) (tool mcp.Tool, handler server.ToolHandlerFunc)
GetMergeRequest defines the MCP tool for retrieving details of a specific merge request.
func GetMergeRequestComments ¶
func GetMergeRequestComments(getClient GetClientFn) (tool mcp.Tool, handler server.ToolHandlerFunc)
GetMergeRequestComments defines the MCP tool for retrieving comments/notes for a specific merge request.
func GetProject ¶
func GetProject(getClient GetClientFn) (tool mcp.Tool, handler server.ToolHandlerFunc)
GetProject defines the MCP tool for retrieving a single GitLab project. Uses named return values to match the expected signature pattern. GetProject defines the MCP tool for retrieving a single GitLab project.
func GetProjectBranches ¶
func GetProjectBranches(getClient GetClientFn) (tool mcp.Tool, handler server.ToolHandlerFunc)
GetProjectBranches defines the MCP tool for listing branches in a project.
func GetProjectCommits ¶
func GetProjectCommits(getClient GetClientFn) (tool mcp.Tool, handler server.ToolHandlerFunc)
GetProjectCommits defines the MCP tool for listing commits in a project.
func GetProjectFile ¶
func GetProjectFile(getClient GetClientFn) (tool mcp.Tool, handler server.ToolHandlerFunc)
GetProjectFile defines the MCP tool for retrieving the content of a file in a project.
func InitToolsets ¶
func InitToolsets( enabledToolsets []string, readOnly bool, getClient GetClientFn, ) (*toolsets.ToolsetGroup, error)
InitToolsets initializes the ToolsetGroup with GitLab-specific toolsets. It accepts a function to retrieve the GitLab client.
func ListIssues ¶
func ListIssues(getClient GetClientFn) (tool mcp.Tool, handler server.ToolHandlerFunc)
ListIssues defines the MCP tool for listing issues with filtering and pagination.
func ListMergeRequests ¶
func ListMergeRequests(getClient GetClientFn) (tool mcp.Tool, handler server.ToolHandlerFunc)
ListMergeRequests defines the MCP tool for listing merge requests with pagination and filtering.
func ListProjectFiles ¶
func ListProjectFiles(getClient GetClientFn) (tool mcp.Tool, handler server.ToolHandlerFunc)
ListProjectFiles defines the MCP tool for listing files in a project directory.
func ListProjects ¶
func ListProjects(getClient GetClientFn) (tool mcp.Tool, handler server.ToolHandlerFunc)
ListProjects defines the MCP tool for listing GitLab projects.
func NewServer ¶
NewServer creates a new MCP server instance with default options suitable for GitLab.
func OptionalBoolParam ¶
func OptionalBoolParam(r *mcp.CallToolRequest, p string) (*bool, error)
OptionalBoolParam retrieves an optional boolean parameter from the request arguments. It returns a pointer to the boolean value if found and valid, or nil if not present. Returns an error if the parameter exists but is not a valid boolean.
func OptionalIntParam ¶
func OptionalIntParam(r *mcp.CallToolRequest, p string) (int, error)
OptionalIntParam fetches an optional integer parameter, handling potential float64 from JSON.
func OptionalIntParamWithDefault ¶
OptionalIntParamWithDefault fetches an optional integer parameter, returning a default value if absent or error.
func OptionalPaginationParams ¶
func OptionalPaginationParams(req *mcp.CallToolRequest) (page, perPage int, err error)
OptionalPaginationParams extracts page and per_page parameters from the request. It applies default and max values.
func OptionalParam ¶
func OptionalParam[T any](r *mcp.CallToolRequest, p string) (T, error)
OptionalParam fetches an optional parameter, returns its zero value if absent, checks type if present.
func OptionalParamOK ¶
OptionalParamOK fetches an optional parameter, returning value, presence bool, and type error.
func OptionalTimeParam ¶
OptionalTimeParam parses an optional ISO 8601 timestamp string parameter. It returns nil if the parameter is missing, empty, or null.
func WithPagination ¶
func WithPagination() mcp.ToolOption
WithPagination returns a ToolOption to add standard 'page' and 'per_page' parameters. Parameters are optional by default.