forgejo-mcp/operation/params/params.go
Christoph Görn 4fea365203
feat: ✨ add Actions support (dispatch_workflow, list_workflow_runs, get_workflow_run)
- Upgrade forgejo-sdk to v2.2.1-pre (post-PR #103 merge) which adds
  ActionRun, DispatchWorkflowOption, ListRepoActionRuns, etc.
- Add operation/actions package with three MCP tools:
  - dispatch_workflow: trigger a workflow run via workflow_dispatch event
  - list_workflow_runs: list runs with filtering by status/event/SHA
  - get_workflow_run: get details of a specific run by ID
- Add Actions-specific params: Workflow, Inputs, Event, RunNumber, HeadSHA, RunID, Status
- Add pkg/forgejo.GetBaseURL() helper
- Fix operation/pull/pull.go: adapt to SDK change (Body field is now *string)
- Add 11 tests with mock HTTP server

Closes #60

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-18 14:03:03 +01:00

80 lines
2.3 KiB
Go

package params
// Shared parameter descriptions for MCP tools
// Following Anthropic's guideline: "be frugal with their use of tokens"
// Patterns follow official MCP server conventions (GitHub, MCP spec examples)
const (
// Common repository parameters
Owner = "Repository owner"
Repo = "Repository name"
// Issue/PR parameters
Index = "Issue/PR index"
IssueIndex = "Issue index"
PRIndex = "PR index"
CommentID = "Comment ID"
Body = "Content body"
Title = "Title"
State = "State"
Labels = "Label IDs"
Milestone = "Milestone ID"
// Branch parameters
Branch = "Branch name"
OldBranch = "Source branch"
Head = "Head branch"
Base = "Base branch"
// File parameters
FilePath = "File path"
Content = "Content (plain text, will be base64-encoded automatically)"
Message = "Commit message"
BranchName = "Branch name"
NewBranchName = "New branch name"
Ref = "Ref (branch/tag/commit)"
SHA = "SHA"
// Pagination parameters
Page = "Page number (1-based)"
Limit = "Page size"
// Time parameters
Since = "After time (RFC3339)"
Before = "Before time (RFC3339)"
// Sort/filter parameters
Sort = "Sort order"
Order = "Order direction"
Keyword = "Search keyword"
// User/org parameters
User = "Username"
Org = "Organization name"
// Wiki parameters
WikiTitle = "Wiki page title"
WikiContent = "Wiki page content"
WikiPage = "Wiki page name"
// Review parameters
ReviewID = "Review ID"
ReviewState = "Review state (APPROVED, REQUEST_CHANGES, COMMENT)"
ReviewBody = "Review body/message"
Reviewers = "Reviewer usernames (comma-separated)"
TeamReviewers = "Team reviewer names (comma-separated)"
DismissMessage = "Dismissal message"
ReviewComments = `Inline comments as JSON array, e.g. [{"path":"file.go","body":"Fix this","new_position":10}]`
// Actions parameters
Workflow = "Workflow file or ID (e.g. main.yml)"
Inputs = `Workflow inputs as JSON object (e.g. {"key": "value"})`
Event = "Filter by event type (e.g. push, pull_request, workflow_dispatch)"
RunNumber = "Filter by run number"
HeadSHA = "Filter by HEAD SHA"
RunID = "Run ID"
Status = "Filter by status (e.g. waiting, running, success, failure, cancelled)"
// Misc parameters
Description = "Description"
Private = "Private repo"
)