Documentation
¶
Overview ¶
Package keys implements MCP tools for GitLab SSH key lookup operations.
Index ¶
- func FormatMarkdown(out Output) *mcp.CallToolResult
- func FormatMarkdownString(out Output) string
- func RegisterMeta(server *mcp.Server, client *gitlabclient.Client)
- func RegisterTools(server *mcp.Server, client *gitlabclient.Client)
- type GetByFingerprintInput
- type GetByIDInput
- type Output
- type UserOutput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatMarkdown ¶
func FormatMarkdown(out Output) *mcp.CallToolResult
FormatMarkdown formats a key as Markdown.
func FormatMarkdownString ¶
FormatMarkdownString renders a key as Markdown.
func RegisterMeta ¶
func RegisterMeta(server *mcp.Server, client *gitlabclient.Client)
RegisterMeta registers the gitlab_key meta-tool.
func RegisterTools ¶
func RegisterTools(server *mcp.Server, client *gitlabclient.Client)
RegisterTools registers all key tools on the MCP server.
Types ¶
type GetByFingerprintInput ¶
type GetByFingerprintInput struct {
Fingerprint string `json:"fingerprint" jsonschema:"SSH key fingerprint (e.g. SHA256:abc123 or MD5:aa:bb:cc),required"`
}
GetByFingerprintInput is the input for getting a key by fingerprint.
type GetByIDInput ¶
type GetByIDInput struct {
KeyID int64 `json:"key_id" jsonschema:"SSH key ID,required"`
}
GetByIDInput is the input for getting a key by its ID.
type Output ¶
type Output struct {
toolutil.HintableOutput
ID int64 `json:"id"`
Title string `json:"title"`
Key string `json:"key"`
CreatedAt string `json:"created_at,omitempty"`
User UserOutput `json:"user"`
}
Output represents an SSH key with its associated user.
func GetKeyByFingerprint ¶
func GetKeyByFingerprint(ctx context.Context, client *gitlabclient.Client, input GetByFingerprintInput) (Output, error)
GetKeyByFingerprint retrieves an SSH key by its fingerprint.
func GetKeyWithUser ¶
func GetKeyWithUser(ctx context.Context, client *gitlabclient.Client, input GetByIDInput) (Output, error)
GetKeyWithUser retrieves an SSH key and the user it belongs to.
type UserOutput ¶
type UserOutput struct {
ID int64 `json:"id"`
Username string `json:"username"`
Name string `json:"name"`
}
UserOutput represents the user associated with a key.
Click to show internal directories.
Click to hide internal directories.