pullreq

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2025 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package pullreq provides MCP tools for interacting with Forgejo pull requests.

It includes tools for listing and retrieving pull requests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GetPullRequestImpl

type GetPullRequestImpl struct {
	Client *tools.Client
}

GetPullRequestImpl implements the read-only MCP tool for fetching a single pull request. This is a safe, idempotent operation that uses the Forgejo SDK to retrieve detailed information about a specific pull request.

func (GetPullRequestImpl) Definition

func (GetPullRequestImpl) Definition() *mcp.Tool

Definition describes the `get_pull_request` tool. It requires `owner`, `repo`, and the pull request `index`. It is marked as a safe, read-only operation.

func (GetPullRequestImpl) Handler

Handler implements the logic for fetching a pull request. It calls the Forgejo SDK's `GetPullRequest` function and formats the result into a detailed markdown view. It will return an error if the pull request is not found.

type GetPullRequestParams

type GetPullRequestParams 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"`
	// Index is the pull request number.
	Index int `json:"index"`
}

GetPullRequestParams defines the parameters for the get_pull_request tool. It specifies the pull request to retrieve by its owner, repository, and index.

type ListPullRequestsImpl

type ListPullRequestsImpl struct {
	Client *tools.Client
}

ListPullRequestsImpl implements the read-only MCP tool for listing pull requests. This is a safe, idempotent operation that uses the Forgejo SDK to fetch a list of pull requests with powerful filtering and sorting capabilities.

func (ListPullRequestsImpl) Definition

func (ListPullRequestsImpl) Definition() *mcp.Tool

Definition describes the `list_pull_requests` tool. It requires `owner` and `repo` and supports a rich set of optional parameters for filtering and sorting. It is marked as a safe, read-only operation.

func (ListPullRequestsImpl) Handler

Handler implements the logic for listing pull requests. It calls the Forgejo SDK's `ListRepoPullRequests` function with the provided filters and formats the results into a markdown table.

type ListPullRequestsParams

type ListPullRequestsParams 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 pull requests by their state (e.g., 'open', 'closed').
	State string `json:"state,omitempty"`
	// Sort specifies the sort order for the results.
	Sort string `json:"sort,omitempty"`
	// Direction specifies the sort direction (asc or desc).
	Direction string `json:"direction,omitempty"`
	// Milestone filters pull requests by a milestone title.
	Milestone string `json:"milestone,omitempty"`
	// Labels filters pull requests by a list of label names.
	Labels []string `json:"labels,omitempty"`
	// Page is the page number for pagination.
	Page int `json:"page,omitempty"`
	// Limit is the number of pull requests to return per page.
	Limit int `json:"limit,omitempty"`
}

ListPullRequestsParams defines the parameters for the list_pull_requests tool. It includes options for filtering, sorting, and paginating pull requests.

Jump to

Keyboard shortcuts

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