Documentation
¶
Overview ¶
Package milestone provides MCP tools for managing Forgejo milestones.
It includes tools for listing, creating, editing, and deleting milestones within a repository.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateMilestoneImpl ¶
CreateMilestoneImpl implements the MCP tool for creating a new milestone. This is a non-idempotent operation that creates a new milestone object using the Forgejo SDK.
func (CreateMilestoneImpl) Definition ¶
func (CreateMilestoneImpl) Definition() *mcp.Tool
Definition describes the `create_milestone` tool. It requires `owner`, `repo`, and a `title`. It is not idempotent, as multiple calls with the same title will create multiple milestones.
func (CreateMilestoneImpl) Handler ¶
func (impl CreateMilestoneImpl) Handler() mcp.ToolHandlerFor[CreateMilestoneParams, any]
Handler implements the logic for creating a milestone. It calls the Forgejo SDK's `CreateMilestone` function and returns the details of the newly created milestone.
type CreateMilestoneParams ¶
type CreateMilestoneParams struct {
// Owner is the username or organization name that owns the repository.
Owner string `json:"owner"`
// Repo is the name of the repository.
Repo string `json:"repo"`
// Title is the title of the new milestone.
Title string `json:"title"`
// Description is the markdown description of the milestone.
Description string `json:"description,omitempty"`
// DueDate is the optional due date for the milestone.
DueDate time.Time `json:"due_date,omitempty"`
}
CreateMilestoneParams defines the parameters for the create_milestone tool. It includes the title and optional description and due date.
type DeleteMilestoneImpl ¶
DeleteMilestoneImpl implements the destructive MCP tool for deleting a milestone. This is an idempotent but irreversible operation that removes a milestone from a repository using the Forgejo SDK.
func (DeleteMilestoneImpl) Definition ¶
func (DeleteMilestoneImpl) Definition() *mcp.Tool
Definition describes the `delete_milestone` tool. It requires `owner`, `repo`, and the milestone `id`. It is marked as a destructive operation to ensure clients can warn the user before execution.
func (DeleteMilestoneImpl) Handler ¶
func (impl DeleteMilestoneImpl) Handler() mcp.ToolHandlerFor[DeleteMilestoneParams, any]
Handler implements the logic for deleting a milestone. It calls the Forgejo SDK's `DeleteMilestone` function. On success, it returns a simple text confirmation. It will return an error if the milestone does not exist.
type DeleteMilestoneParams ¶
type DeleteMilestoneParams struct {
// Owner is the username or organization name that owns the repository.
Owner string `json:"owner"`
// Repo is the name of the repository.
Repo string `json:"repo"`
// ID is the unique identifier of the milestone to delete.
ID int `json:"id"`
}
DeleteMilestoneParams defines the parameters for the delete_milestone tool. It specifies the milestone to be deleted by its ID.
type EditMilestoneImpl ¶
EditMilestoneImpl implements the MCP tool for editing an existing milestone. This is an idempotent operation that modifies a milestone's metadata using the Forgejo SDK.
func (EditMilestoneImpl) Definition ¶
func (EditMilestoneImpl) Definition() *mcp.Tool
Definition describes the `edit_milestone` tool. It requires `owner`, `repo`, and the milestone `id`. It is marked as idempotent.
func (EditMilestoneImpl) Handler ¶
func (impl EditMilestoneImpl) Handler() mcp.ToolHandlerFor[EditMilestoneParams, any]
Handler implements the logic for editing a milestone. It calls the Forgejo SDK's `EditMilestone` function. It will return an error if the milestone ID is not found.
type EditMilestoneParams ¶
type EditMilestoneParams struct {
// Owner is the username or organization name that owns the repository.
Owner string `json:"owner"`
// Repo is the name of the repository.
Repo string `json:"repo"`
// ID is the unique identifier of the milestone to edit.
ID int `json:"id"`
// Title is the new title for the milestone.
Title string `json:"title,omitempty"`
// Description is the new markdown description for the milestone.
Description string `json:"description,omitempty"`
// DueDate is the new optional due date for the milestone.
DueDate time.Time `json:"due_date,omitempty"`
// State is the new state for the milestone (e.g., 'open', 'closed').
State string `json:"state,omitempty"`
}
EditMilestoneParams defines the parameters for the edit_milestone tool. It specifies the milestone to edit by ID and the fields to update.
type ListRepoMilestonesImpl ¶
ListRepoMilestonesImpl implements the read-only MCP tool for listing repository milestones. This is a safe, idempotent operation that uses the Forgejo SDK to fetch a list of milestones, optionally filtered by their state.
func (ListRepoMilestonesImpl) Definition ¶
func (ListRepoMilestonesImpl) Definition() *mcp.Tool
Definition describes the `list_repo_milestones` tool. It requires `owner` and `repo`, supports an optional `state` filter, and is marked as a safe, read-only operation.
func (ListRepoMilestonesImpl) Handler ¶
func (impl ListRepoMilestonesImpl) Handler() mcp.ToolHandlerFor[ListRepoMilestonesParams, any]
Handler implements the logic for listing milestones. It calls the Forgejo SDK's `ListRepoMilestones` function and formats the results into a markdown list.
type ListRepoMilestonesParams ¶
type ListRepoMilestonesParams struct {
// Owner is the username or organization name that owns the repository.
Owner string `json:"owner"`
// Repo is the name of the repository.
Repo string `json:"repo"`
// State filters milestones by their state (e.g., 'open', 'closed').
State string `json:"state,omitempty"`
}
ListRepoMilestonesParams defines the parameters for the list_repo_milestones tool. It specifies the repository and an optional state filter.