{"modulePath":"github.com/gitopia/gitopia-mcp-server","version":"v0.1.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package handler\n\n## Functions\n\n```go\nfunc AuditLog(toolName, walletAddress string, success bool, duration time.Duration, detail string)\n```\nAuditLog emits a structured log entry for chain-write operations. Non-blocking, uses existing logrus infrastructure.\n\n```go\nfunc CheckTrust(currentLevel TrustLevel, toolName string) error\n```\nCheckTrust returns an error if the current trust level is insufficient for the tool.\n\n```go\nfunc DryRunResult(toolName string, params any) (*mcp.CallToolResult, any, error)\n```\nDryRunResult returns a JSON preview of the operation that would be performed without actually signing or broadcasting it.\n\n```go\nfunc IsToolEnabled(toolName string, activeToolsets map[Toolset]bool) bool\n```\nIsToolEnabled checks if a tool should be registered given the active toolsets.\n\n```go\nfunc ParseToolsets(s string) map[Toolset]bool\n```\nParseToolsets parses a comma-separated toolset string. Empty string or \"all\" enables all toolsets.\n\n```go\nfunc RegisterAll(srv *mcp.Server, h *ToolHandler)\n```\nRegisterAll registers all tools, prompts, and resource templates on the given MCP server using handlers from h and the provided gitopia client. This is extracted from cmd/server/main.go so that both the production binary and integration tests share the exact same registration.\n\n## Types\n\n```go\ntype BatchExecuteParams struct {\n\tOperations []BatchOperation `json:\"operations\" jsonschema:\"List of operations to execute in a single transaction (max 10)\"`\n}\n```\nBatchExecuteParams holds parameters for the batch\\_execute tool.\n\n```go\ntype BatchOperation struct {\n\tTool   string         `json:\"tool\" jsonschema:\"The tool name to execute\"`\n\tParams map[string]any `json:\"params\" jsonschema:\"Parameters for the tool as a JSON object\"`\n}\n```\nBatchOperation represents a single operation in a batch transaction.\n\n```go\ntype BootstrapRepoParams struct {\n\tOwnerId           string `json:\"owner_id\"`\n\tName              string `json:\"name\"`\n\tLocalPath         string `json:\"local_path,omitempty\"`\n\tDescription       string `json:\"description,omitempty\"`\n\tCreateReadme      bool   `json:\"create_readme\"`\n\tCreateGitignore   bool   `json:\"create_gitignore\"`\n\tInitialBranch     string `json:\"initial_branch,omitempty\"`\n\tGitignoreTemplate string `json:\"gitignore_template,omitempty\"`\n}\n```\n\n```go\ntype ClaimFeeGrantParams struct {\n\tAddress string `json:\"address,omitempty\" jsonschema:\"If empty, uses current wallet address\"`\n}\n```\nClaimFeeGrantParams holds parameters for the claim\\_fee\\_grant tool.\n\n```go\ntype CloseBountyParams struct {\n\tBountyID uint64 `json:\"bounty_id\"`\n}\n```\n\n```go\ntype CoinParam struct {\n\tDenom  string `json:\"denom\" jsonschema:\"Token denomination (e.g. ulore)\"`\n\tAmount string `json:\"amount\" jsonschema:\"Token amount as string (e.g. 1000)\"`\n}\n```\nCoinParam is a JSON-schema-friendly representation of a coin amount. sdk.Coin uses math.Int which produces \"type\":\"object\" in JSON schema; this struct produces correct \"type\":\"string\" for the amount field.\n\n```go\ntype CommentOnIssueParams struct {\n\tOwner    string `json:\"owner\" jsonschema:\"Repository owner (username or DAO name)\"`\n\tName     string `json:\"name\" jsonschema:\"Repository name\"`\n\tIssueIid uint64 `json:\"issue_iid\" jsonschema:\"Issue number (IID)\"`\n\tBody     string `json:\"body\" jsonschema:\"Comment body text\"`\n}\n```\n\n```go\ntype CommentOnPullRequestParams struct {\n\tOwner    string `json:\"owner\" jsonschema:\"Repository owner (username or DAO name)\"`\n\tName     string `json:\"name\" jsonschema:\"Repository name\"`\n\tPullIid  uint64 `json:\"pull_iid\" jsonschema:\"Pull request number (IID)\"`\n\tBody     string `json:\"body\" jsonschema:\"Comment body text\"`\n\tDiffHunk string `json:\"diff_hunk,omitempty\" jsonschema:\"Diff hunk for inline comment\"`\n\tPath     string `json:\"path,omitempty\" jsonschema:\"File path for inline comment\"`\n\tPosition uint64 `json:\"position,omitempty\" jsonschema:\"Line position for inline comment\"`\n}\n```\n\n```go\ntype CommitAndPushChangesParams struct {\n\tRepoPath      string   `json:\"repo_path\" jsonschema:\"Repository path relative to workspace\"`\n\tCommitMessage string   `json:\"commit_message\" jsonschema:\"Commit message\"`\n\tFiles         []string `json:\"files,omitempty\" jsonschema:\"Specific files to stage (empty for all)\"`\n\tBranch        string   `json:\"branch,omitempty\" jsonschema:\"Target branch (current if empty)\"`\n\tCreateBranch  bool     `json:\"create_branch,omitempty\" jsonschema:\"Create branch if it does not exist\"`\n}\n```\n\n```go\ntype ConfirmTransactionParams struct {\n\tPendingID string `json:\"pending_id\" jsonschema:\"The ID of the pending transaction to confirm\"`\n}\n```\n\n```go\ntype CreateBountyParams struct {\n\tOwner    string      `json:\"owner\"`\n\tName     string      `json:\"name\"`\n\tIssueIID uint64      `json:\"issue_iid\"`\n\tAmount   []CoinParam `json:\"amount\"`\n\tExpiry   int64       `json:\"expiry,omitempty\"`\n}\n```\n\n```go\ntype CreateDaoParams struct {\n\tName        string `json:\"name\"`\n\tDescription string `json:\"description\"`\n\tAvatarURL   string `json:\"avatar_url,omitempty\"`\n\tLocation    string `json:\"location,omitempty\"`\n\tWebsite     string `json:\"website,omitempty\"`\n\tMembers     []struct {\n\t\tAddress  string `json:\"address\"`\n\t\tWeight   string `json:\"weight\"`\n\t\tMetadata string `json:\"metadata,omitempty\"`\n\t} `json:\"members,omitempty\"`\n\tVotingPeriod string                  `json:\"voting_period,omitempty\"`\n\tPercentage   string                  `json:\"percentage,omitempty\"`\n\tConfig       *gitopiatypes.DaoConfig `json:\"config,omitempty\"`\n}\n```\n\n```go\ntype CreateFeatureBranchPRParams struct {\n\tRepoPath      string          `json:\"repo_path\" jsonschema:\"Repository path relative to workspace (e.g. 'myrepo')\"`\n\tOwner         string          `json:\"owner\"`\n\tName          string          `json:\"name\"`\n\tBranchName    string          `json:\"branch_name\"`\n\tBaseBranch    string          `json:\"base_branch,omitempty\"`\n\tFiles         []fs.FileChange `json:\"files\"`\n\tCommitMessage string          `json:\"commit_message\"`\n\tPRTitle       string          `json:\"pr_title\"`\n\tPRDescription string          `json:\"pr_description\"`\n\tAssignees     []string        `json:\"assignees,omitempty\"`\n\tLabels        []uint64        `json:\"labels,omitempty\"`\n}\n```\n\n```go\ntype CreateFeatureBranchParams struct {\n\tRepoPath   string `json:\"repo_path\"`\n\tBranchName string `json:\"branch_name\"`\n\tBaseBranch string `json:\"base_branch,omitempty\"`\n}\n```\n\n```go\ntype CreateIssueParams struct {\n\tOwner       string `json:\"owner\"`\n\tName        string `json:\"name\"`\n\tTitle       string `json:\"title\"`\n\tDescription string `json:\"description\"`\n}\n```\n\n```go\ntype CreateLabelParams struct {\n\tOwner       string `json:\"owner\" jsonschema:\"Repository owner (username or DAO name)\"`\n\tName        string `json:\"name\" jsonschema:\"Repository name\"`\n\tLabelName   string `json:\"label_name\" jsonschema:\"Label name (3-63 characters)\"`\n\tColor       string `json:\"color\" jsonschema:\"Label color as hex code (e.g. FF0000)\"`\n\tDescription string `json:\"description,omitempty\" jsonschema:\"Label description (max 255 characters)\"`\n}\n```\n\n```go\ntype CreatePullRequestParams struct {\n\tOwner       string   `json:\"owner\"`\n\tName        string   `json:\"name\"`\n\tTitle       string   `json:\"title\"`\n\tDescription string   `json:\"description\"`\n\tHeadBranch  string   `json:\"head_branch\"`\n\tBaseBranch  string   `json:\"base_branch\"`\n\tAssignees   []string `json:\"assignees,omitempty\"`\n\tLabels      []uint64 `json:\"labels,omitempty\"`\n\tIssueIids   []uint64 `json:\"issue_iids,omitempty\"`\n}\n```\n\n```go\ntype CreateReleaseParams struct {\n\tOwner       string `json:\"owner\" jsonschema:\"Repository owner (username or DAO name)\"`\n\tName        string `json:\"name\" jsonschema:\"Repository name\"`\n\tTagName     string `json:\"tag_name\" jsonschema:\"Tag name for the release (e.g. v1.0.0)\"`\n\tTarget      string `json:\"target,omitempty\" jsonschema:\"Branch or commit SHA to tag (defaults to default branch HEAD)\"`\n\tReleaseName string `json:\"release_name\" jsonschema:\"Human-readable release title\"`\n\tDescription string `json:\"description,omitempty\" jsonschema:\"Release notes / description\"`\n\tDraft       bool   `json:\"draft,omitempty\" jsonschema:\"Mark as draft release\"`\n\tPreRelease  bool   `json:\"pre_release,omitempty\" jsonschema:\"Mark as pre-release\"`\n\tProvider    string `json:\"provider,omitempty\" jsonschema:\"Git server provider address (defaults to gitopia15nv5vf6fmww8cxr6emrzxjvj36x5n8xvsxsqpw)\"`\n}\n```\n\n```go\ntype CreateRepoParams struct {\n\tOwnerId     string `json:\"owner_id,omitempty\"`\n\tName        string `json:\"name\"`\n\tDescription string `json:\"description,omitempty\"`\n}\n```\n\n```go\ntype CreateUserParams struct {\n\tUsername string `json:\"username\" jsonschema:\"Gitopia username (3-39 chars, alphanumeric and hyphens)\"`\n}\n```\nCreateUserParams holds parameters for the create\\_user tool.\n\n```go\ntype DeleteBountyParams struct {\n\tBountyID uint64 `json:\"bounty_id\"`\n}\n```\n\n```go\ntype DeleteLabelParams struct {\n\tOwner   string `json:\"owner\" jsonschema:\"Repository owner (username or DAO name)\"`\n\tName    string `json:\"name\" jsonschema:\"Repository name\"`\n\tLabelID uint64 `json:\"label_id\" jsonschema:\"Label ID to delete (from list_labels)\"`\n}\n```\n\n```go\ntype ErrorCode string\n```\nErrorCode represents a machine-readable error classification.\n\n```go\nconst (\n\tErrClientUnavailable ErrorCode = \"CLIENT_UNAVAILABLE\"\n\tErrAuthFailed        ErrorCode = \"AUTH_FAILED\"\n\tErrRateLimited       ErrorCode = \"RATE_LIMITED\"\n\tErrValidation        ErrorCode = \"VALIDATION_ERROR\"\n\tErrNotFound          ErrorCode = \"NOT_FOUND\"\n\tErrConflict          ErrorCode = \"CONFLICT\"\n\tErrNotRepository     ErrorCode = \"NOT_REPOSITORY\"\n\tErrPathTraversal     ErrorCode = \"PATH_TRAVERSAL\"\n\tErrChainTx           ErrorCode = \"CHAIN_TX_FAILED\"\n\tErrGitOperation      ErrorCode = \"GIT_OPERATION_FAILED\"\n\tErrFileSystem        ErrorCode = \"FS_ERROR\"\n\tErrApproval          ErrorCode = \"APPROVAL_ERROR\"\n\tErrInternal          ErrorCode = \"INTERNAL_ERROR\"\n)\n```\n\n```go\ntype ExecDaoProposalParams struct {\n\tProposalID uint64 `json:\"proposal_id\" jsonschema:\"The unique ID of the proposal to execute\"`\n}\n```\n\n```go\ntype ForkRepositoryParams struct {\n\tOwner           string `json:\"owner\" jsonschema:\"Source repository owner (username or DAO name)\"`\n\tName            string `json:\"name\" jsonschema:\"Source repository name\"`\n\tForkName        string `json:\"fork_name,omitempty\" jsonschema:\"Name for the forked repository (defaults to source name)\"`\n\tForkDescription string `json:\"fork_description,omitempty\" jsonschema:\"Description for the fork\"`\n\tBranch          string `json:\"branch,omitempty\" jsonschema:\"Branch to fork (defaults to all branches)\"`\n\tForkOwner       string `json:\"fork_owner,omitempty\" jsonschema:\"Owner of the fork (defaults to authenticated user)\"`\n}\n```\n\n```go\ntype GetBountyParams struct {\n\tBountyID uint64 `json:\"bounty_id\" jsonschema:\"The ID of the bounty to retrieve\"`\n}\n```\n\n```go\ntype GetDaoParams struct {\n\tID string `json:\"id\" jsonschema:\"DAO name or address\"`\n}\n```\n\n```go\ntype GetDaoProposalParams struct {\n\tProposalID uint64 `json:\"proposal_id\" jsonschema:\"The unique ID of the proposal\"`\n}\n```\n\n```go\ntype GetFileParams struct {\n\tOwner  string `json:\"owner\"`\n\tName   string `json:\"name\"`\n\tBranch string `json:\"branch\"`\n\tPath   string `json:\"path\"`\n}\n```\n\n```go\ntype GetIssueParams struct {\n\tOwner    string `json:\"owner\" jsonschema:\"Repository owner (username or DAO name)\"`\n\tName     string `json:\"name\" jsonschema:\"Repository name\"`\n\tIssueIid uint64 `json:\"issue_iid\" jsonschema:\"Issue number (IID)\"`\n}\n```\n\n```go\ntype GetPullRequestDiffParams struct {\n\tOwner   string `json:\"owner\" jsonschema:\"Repository owner (username or DAO name)\"`\n\tName    string `json:\"name\" jsonschema:\"Repository name\"`\n\tPullIid uint64 `json:\"pull_iid\" jsonschema:\"Pull request number (IID)\"`\n\tLimit   int    `json:\"limit,omitempty\" jsonschema:\"Maximum number of file diffs to return (default 50)\"`\n}\n```\n\n```go\ntype GetPullRequestParams struct {\n\tOwner   string `json:\"owner\" jsonschema:\"Repository owner (username or DAO name)\"`\n\tName    string `json:\"name\" jsonschema:\"Repository name\"`\n\tPullIid uint64 `json:\"pull_iid\" jsonschema:\"Pull request number (IID)\"`\n}\n```\n\n```go\ntype GetRepoParams struct {\n\tOwner string `json:\"owner\"`\n\tName  string `json:\"name\"`\n}\n```\n\n```go\ntype GitAddParams struct {\n\tRepoPath string   `json:\"repo_path\" jsonschema:\"Repository path relative to workspace\"`\n\tFiles    []string `json:\"files\" jsonschema:\"Files to stage. Use '.' to stage all changes.\"`\n}\n```\n\n```go\ntype GitCloneParams struct {\n\tRepoURL   string `json:\"repo_url\" jsonschema:\"gitopia:// URL or owner/name format\"`\n\tLocalPath string `json:\"local_path\" jsonschema:\"Path relative to workspace root\"`\n\tBranch    string `json:\"branch,omitempty\" jsonschema:\"Specific branch to clone\"`\n\tDepth     int    `json:\"depth,omitempty\" jsonschema:\"Shallow clone depth\"`\n}\n```\n\n```go\ntype GitCommitParams struct {\n\tRepoPath    string `json:\"repo_path\" jsonschema:\"Repository path relative to workspace\"`\n\tMessage     string `json:\"message\" jsonschema:\"The commit message\"`\n\tAuthorName  string `json:\"author_name,omitempty\" jsonschema:\"Optional author name\"`\n\tAuthorEmail string `json:\"author_email,omitempty\" jsonschema:\"Optional author email\"`\n}\n```\n\n```go\ntype GitInitParams struct {\n\tPath      string `json:\"path\" jsonschema:\"Repository path relative to workspace root\"`\n\tRemoteURL string `json:\"remote_url,omitempty\" jsonschema:\"The gitopia URL to set as origin remote\"`\n}\n```\n\n```go\ntype GitPushParams struct {\n\tRepoPath    string `json:\"repo_path\" jsonschema:\"Repository path relative to workspace\"`\n\tRemote      string `json:\"remote,omitempty\" jsonschema:\"Remote name (default: origin)\"`\n\tBranch      string `json:\"branch,omitempty\" jsonschema:\"Branch to push\"`\n\tForce       bool   `json:\"force,omitempty\" jsonschema:\"Force push\"`\n\tSetUpstream bool   `json:\"set_upstream,omitempty\" jsonschema:\"Set upstream tracking\"`\n\tDryRun      bool   `json:\"dry_run,omitempty\" jsonschema:\"Dry run\"`\n}\n```\n\n```go\ntype GitStatusParams struct {\n\tRepoPath string `json:\"repo_path\" jsonschema:\"Repository path relative to workspace\"`\n}\n```\n\n```go\ntype ListBountiesParams struct {\n\tLimit uint64 `json:\"limit,omitempty\" jsonschema:\"Maximum number of bounties to return (default 50)\"`\n}\n```\n\n```go\ntype ListBranchesParams struct {\n\tOwner string `json:\"owner\"`\n\tName  string `json:\"name\"`\n}\n```\n\n```go\ntype ListCommitsParams struct {\n\tOwner  string `json:\"owner\" jsonschema:\"Repository owner (username or DAO name)\"`\n\tName   string `json:\"name\" jsonschema:\"Repository name\"`\n\tBranch string `json:\"branch,omitempty\" jsonschema:\"Branch name (defaults to repo's default branch)\"`\n\tLimit  int    `json:\"limit,omitempty\" jsonschema:\"Maximum number of commits to return (default 50)\"`\n}\n```\n\n```go\ntype ListDaoMembersParams struct {\n\tDAO     string `json:\"dao,omitempty\" jsonschema:\"DAO name or address (alternative to group_id)\"`\n\tGroupID uint64 `json:\"group_id,omitempty\" jsonschema:\"The cosmos group ID of the DAO\"`\n\tLimit   uint64 `json:\"limit,omitempty\" jsonschema:\"Maximum number of members to return (default 100)\"`\n}\n```\n\n```go\ntype ListDaoProposalsParams struct {\n\tDAO                string `json:\"dao,omitempty\" jsonschema:\"DAO name or address (alternative to group_policy_address)\"`\n\tGroupPolicyAddress string `json:\"group_policy_address,omitempty\" jsonschema:\"The group policy account address\"`\n\tLimit              uint64 `json:\"limit,omitempty\" jsonschema:\"Maximum number of proposals to return (default 50)\"`\n}\n```\n\n```go\ntype ListIssuesParams struct {\n\tOwner string `json:\"owner\"`\n\tName  string `json:\"name\"`\n}\n```\n\n```go\ntype ListLabelsParams struct {\n\tOwner string `json:\"owner\" jsonschema:\"Repository owner (username or DAO name)\"`\n\tName  string `json:\"name\" jsonschema:\"Repository name\"`\n}\n```\n\n```go\ntype ListPullRequestsParams struct {\n\tOwner string `json:\"owner\"`\n\tName  string `json:\"name\"`\n\tLimit uint64 `json:\"limit,omitempty\"`\n}\n```\n\n```go\ntype ListReleasesParams struct {\n\tOwner string `json:\"owner\" jsonschema:\"Repository owner (username or DAO name)\"`\n\tName  string `json:\"name\" jsonschema:\"Repository name\"`\n\tLimit uint64 `json:\"limit,omitempty\" jsonschema:\"Maximum number of releases to return (default 50)\"`\n}\n```\n\n```go\ntype ListReposParams struct {\n\tOwner string `json:\"owner\" jsonschema:\"Gitopia account name\"`\n}\n```\n\n```go\ntype ListTagsParams struct {\n\tOwner string `json:\"owner\" jsonschema:\"Repository owner (username or DAO name)\"`\n\tName  string `json:\"name\" jsonschema:\"Repository name\"`\n\tLimit uint64 `json:\"limit,omitempty\" jsonschema:\"Maximum number of tags to return (default 100)\"`\n}\n```\n\n```go\ntype MergePullRequestParams struct {\n\tOwner    string `json:\"owner\" jsonschema:\"Repository owner (username or DAO name)\"`\n\tName     string `json:\"name\" jsonschema:\"Repository name\"`\n\tPullIid  uint64 `json:\"pull_iid\" jsonschema:\"Pull request number (IID)\"`\n\tProvider string `json:\"provider,omitempty\" jsonschema:\"Git server provider address (defaults to gitopia15nv5vf6fmww8cxr6emrzxjvj36x5n8xvsxsqpw)\"`\n}\n```\n\n```go\ntype PendingTx struct {\n\tID            string    `json:\"id\"`\n\tToolName      string    `json:\"tool_name\"`\n\tDetail        string    `json:\"detail\"`\n\tWalletAddress string    `json:\"wallet_address\"`\n\tSessionID     string    `json:\"session_id\"`\n\tCreatedAt     time.Time `json:\"created_at\"`\n\tExpiresAt     time.Time `json:\"expires_at\"`\n\t// contains filtered or unexported fields\n}\n```\nPendingTx represents a chain transaction awaiting user confirmation.\n\n```go\ntype PendingTxStore struct {\n\t// contains filtered or unexported fields\n}\n```\nPendingTxStore is a thread-safe store for pending transactions.\n\n```go\nfunc NewPendingTxStore(ttl time.Duration) *PendingTxStore\n```\nNewPendingTxStore creates a new store with the given TTL.\n\n```go\nfunc (s *PendingTxStore) Add(tx *PendingTx) string\n```\nAdd stores a pending transaction and returns its ID.\n\n```go\nfunc (s *PendingTxStore) Cleanup()\n```\nCleanup removes all expired transactions.\n\n```go\nfunc (s *PendingTxStore) Get(id string) *PendingTx\n```\nGet returns a pending transaction by ID, or nil if missing or expired.\n\n```go\nfunc (s *PendingTxStore) ListForSession(sessionID string) []*PendingTx\n```\nListForSession returns all non-expired pending transactions for a session.\n\n```go\nfunc (s *PendingTxStore) Remove(id string)\n```\nRemove deletes a pending transaction by ID.\n\n```go\ntype PromptHandler struct{}\n```\nPromptHandler holds dependencies for MCP prompt handlers.\n\n```go\nfunc (ph *PromptHandler) FixIssuePrompt(_ context.Context, req *mcp.GetPromptRequest) (*mcp.GetPromptResult, error)\n```\nFixIssuePrompt returns a multi-step workflow to fix an issue.\n\n```go\nfunc (ph *PromptHandler) HuntBountyPrompt(_ context.Context, req *mcp.GetPromptRequest) (*mcp.GetPromptResult, error)\n```\nHuntBountyPrompt returns a multi-step workflow to find and work on bounties.\n\n```go\nfunc (ph *PromptHandler) ReviewPRPrompt(_ context.Context, req *mcp.GetPromptRequest) (*mcp.GetPromptResult, error)\n```\nReviewPRPrompt returns a multi-step workflow to review a pull request.\n\n```go\ntype RateLimiter struct {\n\t// contains filtered or unexported fields\n}\n```\nRateLimiter implements a sliding-window rate limiter for chain transactions.\n\n```go\nfunc NewRateLimiter(perMinute, perHour int) *RateLimiter\n```\nNewRateLimiter creates a new RateLimiter with the given per-minute and per-hour limits.\n\n```go\nfunc (r *RateLimiter) Allow() error\n```\nAllow checks if a new request is allowed. If allowed, it records the request and returns nil. Otherwise it returns an error describing the limit hit.\n\n```go\ntype ReadFileParams struct {\n\tPath string `json:\"path\" jsonschema:\"File path relative to workspace root (e.g. 'myrepo/src/main.go')\"`\n}\n```\n\n```go\ntype RejectTransactionParams struct {\n\tPendingID string `json:\"pending_id\" jsonschema:\"The ID of the pending transaction to reject\"`\n}\n```\n\n```go\ntype ResourceHandler struct {\n\tGClient *gitopia.Client\n}\n```\nResourceHandler holds dependencies for MCP resource handlers.\n\n```go\nfunc (rh *ResourceHandler) HandleBountyResource(_ context.Context, req *mcp.ReadResourceRequest) (*mcp.ReadResourceResult, error)\n```\nHandleBountyResource reads a bounty resource by URI.\n\n```go\nfunc (rh *ResourceHandler) HandleIssueResource(_ context.Context, req *mcp.ReadResourceRequest) (*mcp.ReadResourceResult, error)\n```\nHandleIssueResource reads an issue resource by URI.\n\n```go\nfunc (rh *ResourceHandler) HandlePullRequestResource(_ context.Context, req *mcp.ReadResourceRequest) (*mcp.ReadResourceResult, error)\n```\nHandlePullRequestResource reads a pull request resource by URI.\n\n```go\nfunc (rh *ResourceHandler) HandleRepoResource(_ context.Context, req *mcp.ReadResourceRequest) (*mcp.ReadResourceResult, error)\n```\nHandleRepoResource reads a repository resource by URI.\n\n```go\ntype SearchCodeParams struct {\n\tRepoPath      string `json:\"repo_path\" jsonschema:\"Repository path relative to workspace\"`\n\tQuery         string `json:\"query\" jsonschema:\"Search query string or regex pattern\"`\n\tCaseSensitive bool   `json:\"case_sensitive,omitempty\" jsonschema:\"Whether search should be case-sensitive\"`\n}\n```\n\n```go\ntype SetActiveDAOParams struct {\n\tDaoName string `json:\"dao_name,omitempty\"` // Empty to use personal account\n}\n```\n\n```go\ntype SubmitDaoProposalParams struct {\n\tDAO                string `json:\"dao,omitempty\" jsonschema:\"DAO name or address (alternative to group_policy_address)\"`\n\tGroupPolicyAddress string `json:\"group_policy_address,omitempty\" jsonschema:\"The group policy account address\"`\n\tTitle              string `json:\"title\" jsonschema:\"Title of the proposal\"`\n\tSummary            string `json:\"summary,omitempty\" jsonschema:\"Summary of the proposal\"`\n\tMetadata           string `json:\"metadata,omitempty\" jsonschema:\"Arbitrary metadata for the proposal\"`\n\tExecTry            bool   `json:\"exec_try,omitempty\" jsonschema:\"If true, try to execute immediately after submission\"`\n}\n```\n\n```go\ntype SyncWithRemoteParams struct {\n\tRepoPath string `json:\"repo_path\"`\n\tBranch   string `json:\"branch,omitempty\"`\n\tRemote   string `json:\"remote,omitempty\"`\n\tStrategy string `json:\"strategy,omitempty\"`\n}\n```\n\n```go\ntype ToggleRepositoryForkingParams struct {\n\tOwner string `json:\"owner\" jsonschema:\"Repository owner (username or DAO name)\"`\n\tName  string `json:\"name\" jsonschema:\"Repository name\"`\n}\n```\n\n```go\ntype ToolHandler struct {\n\tGClient        *gitopia.Client\n\tGitClient      *git.Client\n\tAuthMgr        *git.AuthManager\n\tWorkspaceMgr   *workspace.Manager\n\tTrustLvl       TrustLevel\n\tChainLimiter   *RateLimiter\n\tDryRunMode     bool\n\tApprovalMode   bool\n\tPendingTxs     *PendingTxStore\n\tActiveToolsets map[Toolset]bool\n\t// contains filtered or unexported fields\n}\n```\nToolHandler holds shared dependencies for all tool handlers. By making handlers methods on this struct, we can easily share state and dependencies like clients and managers without using globals.\n\n```go\nfunc New(g *gitopia.Client, git *git.Client, auth *git.AuthManager, ws *workspace.Manager) *ToolHandler\n```\nNew creates a new ToolHandler.\n\n```go\nfunc (h *ToolHandler) BatchExecute(\n\tctx context.Context,\n\treq *mcp.CallToolRequest,\n\tp BatchExecuteParams,\n) (*mcp.CallToolResult, any, error)\n```\nBatchExecute executes multiple operations in a single on-chain transaction.\n\n```go\nfunc (h *ToolHandler) BootstrapRepo(\n\tctx context.Context,\n\treq *mcp.CallToolRequest,\n\tp BootstrapRepoParams,\n) (*mcp.CallToolResult, any, error)\n```\n\n```go\nfunc (h *ToolHandler) ClaimFeeGrant(\n\tctx context.Context,\n\treq *mcp.CallToolRequest,\n\tp ClaimFeeGrantParams,\n) (*mcp.CallToolResult, any, error)\n```\nClaimFeeGrant claims a fee grant from the Gitopia faucet.\n\n```go\nfunc (h *ToolHandler) CloseBounty(\n\tctx context.Context,\n\treq *mcp.CallToolRequest,\n\tp CloseBountyParams,\n) (*mcp.CallToolResult, any, error)\n```\n\n```go\nfunc (h *ToolHandler) CommentOnIssue(\n\tctx context.Context,\n\treq *mcp.CallToolRequest,\n\tp CommentOnIssueParams,\n) (*mcp.CallToolResult, any, error)\n```\n\n```go\nfunc (h *ToolHandler) CommentOnPullRequest(\n\tctx context.Context,\n\treq *mcp.CallToolRequest,\n\tp CommentOnPullRequestParams,\n) (*mcp.CallToolResult, any, error)\n```\n\n```go\nfunc (h *ToolHandler) CommitAndPushChanges(\n\tctx context.Context,\n\treq *mcp.CallToolRequest,\n\tp CommitAndPushChangesParams,\n) (*mcp.CallToolResult, any, error)\n```\n\n```go\nfunc (h *ToolHandler) ConfirmTransaction(\n\tctx context.Context,\n\treq *mcp.CallToolRequest,\n\tp ConfirmTransactionParams,\n) (*mcp.CallToolResult, any, error)\n```\nConfirmTransaction broadcasts a previously held pending transaction.\n\n```go\nfunc (h *ToolHandler) CreateBounty(\n\tctx context.Context,\n\treq *mcp.CallToolRequest,\n\tp CreateBountyParams,\n) (*mcp.CallToolResult, any, error)\n```\n\n```go\nfunc (h *ToolHandler) CreateDao(\n\tctx context.Context,\n\treq *mcp.CallToolRequest,\n\tp CreateDaoParams,\n) (*mcp.CallToolResult, any, error)\n```\n\n```go\nfunc (h *ToolHandler) CreateFeatureBranch(\n\tctx context.Context,\n\treq *mcp.CallToolRequest,\n\tp CreateFeatureBranchParams,\n) (*mcp.CallToolResult, any, error)\n```\n\n```go\nfunc (h *ToolHandler) CreateFeatureBranchPR(\n\tctx context.Context,\n\treq *mcp.CallToolRequest,\n\tp CreateFeatureBranchPRParams,\n) (*mcp.CallToolResult, any, error)\n```\n\n```go\nfunc (h *ToolHandler) CreateIssue(\n\tctx context.Context,\n\treq *mcp.CallToolRequest,\n\tp CreateIssueParams,\n) (*mcp.CallToolResult, any, error)\n```\n\n```go\nfunc (h *ToolHandler) CreateLabel(\n\tctx context.Context,\n\treq *mcp.CallToolRequest,\n\tp CreateLabelParams,\n) (*mcp.CallToolResult, any, error)\n```\n\n```go\nfunc (h *ToolHandler) CreatePullRequest(\n\tctx context.Context,\n\treq *mcp.CallToolRequest,\n\tp CreatePullRequestParams,\n) (*mcp.CallToolResult, any, error)\n```\n\n```go\nfunc (h *ToolHandler) CreateRelease(\n\tctx context.Context,\n\treq *mcp.CallToolRequest,\n\tp CreateReleaseParams,\n) (*mcp.CallToolResult, any, error)\n```\n\n```go\nfunc (h *ToolHandler) CreateRepository(\n\tctx context.Context,\n\treq *mcp.CallToolRequest,\n\tp CreateRepoParams,\n) (*mcp.CallToolResult, any, error)\n```\n\n```go\nfunc (h *ToolHandler) CreateUser(\n\tctx context.Context,\n\treq *mcp.CallToolRequest,\n\tp CreateUserParams,\n) (*mcp.CallToolResult, any, error)\n```\nCreateUser creates an on-chain Gitopia user for the current wallet.\n\n```go\nfunc (h *ToolHandler) DeleteBounty(\n\tctx context.Context,\n\treq *mcp.CallToolRequest,\n\tp DeleteBountyParams,\n) (*mcp.CallToolResult, any, error)\n```\n\n```go\nfunc (h *ToolHandler) DeleteLabel(\n\tctx context.Context,\n\treq *mcp.CallToolRequest,\n\tp DeleteLabelParams,\n) (*mcp.CallToolResult, any, error)\n```\n\n```go\nfunc (h *ToolHandler) ExecDaoProposal(\n\tctx context.Context,\n\treq *mcp.CallToolRequest,\n\tp ExecDaoProposalParams,\n) (*mcp.CallToolResult, any, error)\n```\n\n```go\nfunc (h *ToolHandler) ForkRepository(\n\tctx context.Context,\n\treq *mcp.CallToolRequest,\n\tp ForkRepositoryParams,\n) (*mcp.CallToolResult, any, error)\n```\n\n```go\nfunc (h *ToolHandler) GetBounty(\n\tctx context.Context,\n\treq *mcp.CallToolRequest,\n\tp GetBountyParams,\n) (*mcp.CallToolResult, any, error)\n```\n\n```go\nfunc (h *ToolHandler) GetDao(\n\tctx context.Context,\n\treq *mcp.CallToolRequest,\n\tparams GetDaoParams,\n) (*mcp.CallToolResult, any, error)\n```\n\n```go\nfunc (h *ToolHandler) GetDaoProposal(\n\tctx context.Context,\n\treq *mcp.CallToolRequest,\n\tp GetDaoProposalParams,\n) (*mcp.CallToolResult, any, error)\n```\n\n```go\nfunc (h *ToolHandler) GetFile(\n\tctx context.Context,\n\treq *mcp.CallToolRequest,\n\tparams GetFileParams,\n) (*mcp.CallToolResult, any, error)\n```\n\n```go\nfunc (h *ToolHandler) GetIssue(\n\tctx context.Context,\n\treq *mcp.CallToolRequest,\n\tparams GetIssueParams,\n) (*mcp.CallToolResult, any, error)\n```\n\n```go\nfunc (h *ToolHandler) GetPullRequest(\n\tctx context.Context,\n\treq *mcp.CallToolRequest,\n\tparams GetPullRequestParams,\n) (*mcp.CallToolResult, any, error)\n```\n\n```go\nfunc (h *ToolHandler) GetPullRequestDiff(\n\tctx context.Context,\n\treq *mcp.CallToolRequest,\n\tparams GetPullRequestDiffParams,\n) (*mcp.CallToolResult, any, error)\n```\n\n```go\nfunc (h *ToolHandler) GetRepo(\n\tctx context.Context,\n\treq *mcp.CallToolRequest,\n\tparams GetRepoParams,\n) (*mcp.CallToolResult, any, error)\n```\n\n```go\nfunc (h *ToolHandler) GetUserContext(\n\tctx context.Context,\n\treq *mcp.CallToolRequest,\n\t_ struct{},\n) (*mcp.CallToolResult, any, error)\n```\nGetUserContext returns the current user context information\n\n```go\nfunc (h *ToolHandler) GitAdd(\n\tctx context.Context,\n\treq *mcp.CallToolRequest,\n\tp GitAddParams,\n) (*mcp.CallToolResult, any, error)\n```\n\n```go\nfunc (h *ToolHandler) GitClone(\n\tctx context.Context,\n\treq *mcp.CallToolRequest,\n\tp GitCloneParams,\n) (*mcp.CallToolResult, any, error)\n```\n\n```go\nfunc (h *ToolHandler) GitCommit(\n\tctx context.Context,\n\treq *mcp.CallToolRequest,\n\tp GitCommitParams,\n) (*mcp.CallToolResult, any, error)\n```\n\n```go\nfunc (h *ToolHandler) GitInit(\n\tctx context.Context,\n\treq *mcp.CallToolRequest,\n\tp GitInitParams,\n) (*mcp.CallToolResult, any, error)\n```\n\n```go\nfunc (h *ToolHandler) GitPush(\n\tctx context.Context,\n\treq *mcp.CallToolRequest,\n\tp GitPushParams,\n) (*mcp.CallToolResult, any, error)\n```\n\n```go\nfunc (h *ToolHandler) GitStatus(\n\tctx context.Context,\n\treq *mcp.CallToolRequest,\n\tp GitStatusParams,\n) (*mcp.CallToolResult, any, error)\n```\n\n```go\nfunc (h *ToolHandler) ListBounties(\n\tctx context.Context,\n\treq *mcp.CallToolRequest,\n\tp ListBountiesParams,\n) (*mcp.CallToolResult, any, error)\n```\n\n```go\nfunc (h *ToolHandler) ListBranches(\n\tctx context.Context,\n\treq *mcp.CallToolRequest,\n\tparams ListBranchesParams,\n) (*mcp.CallToolResult, any, error)\n```\n\n```go\nfunc (h *ToolHandler) ListCommits(\n\tctx context.Context,\n\treq *mcp.CallToolRequest,\n\tparams ListCommitsParams,\n) (*mcp.CallToolResult, any, error)\n```\n\n```go\nfunc (h *ToolHandler) ListDaoMembers(\n\tctx context.Context,\n\treq *mcp.CallToolRequest,\n\tp ListDaoMembersParams,\n) (*mcp.CallToolResult, any, error)\n```\n\n```go\nfunc (h *ToolHandler) ListDaoProposals(\n\tctx context.Context,\n\treq *mcp.CallToolRequest,\n\tp ListDaoProposalsParams,\n) (*mcp.CallToolResult, any, error)\n```\n\n```go\nfunc (h *ToolHandler) ListIssues(\n\tctx context.Context,\n\treq *mcp.CallToolRequest,\n\tparams ListIssuesParams,\n) (*mcp.CallToolResult, any, error)\n```\n\n```go\nfunc (h *ToolHandler) ListLabels(\n\tctx context.Context,\n\treq *mcp.CallToolRequest,\n\tparams ListLabelsParams,\n) (*mcp.CallToolResult, any, error)\n```\n\n```go\nfunc (h *ToolHandler) ListPendingTransactions(\n\tctx context.Context,\n\treq *mcp.CallToolRequest,\n\t_ struct{},\n) (*mcp.CallToolResult, any, error)\n```\nListPendingTransactions lists all non-expired pending transactions for the current session.\n\n```go\nfunc (h *ToolHandler) ListPullRequests(\n\tctx context.Context,\n\treq *mcp.CallToolRequest,\n\tp ListPullRequestsParams,\n) (*mcp.CallToolResult, any, error)\n```\n\n```go\nfunc (h *ToolHandler) ListReleases(\n\tctx context.Context,\n\treq *mcp.CallToolRequest,\n\tparams ListReleasesParams,\n) (*mcp.CallToolResult, any, error)\n```\n\n```go\nfunc (h *ToolHandler) ListRepos(\n\tctx context.Context,\n\treq *mcp.CallToolRequest,\n\tparams ListReposParams,\n) (*mcp.CallToolResult, any, error)\n```\n\n```go\nfunc (h *ToolHandler) ListTags(\n\tctx context.Context,\n\treq *mcp.CallToolRequest,\n\tparams ListTagsParams,\n) (*mcp.CallToolResult, any, error)\n```\n\n```go\nfunc (h *ToolHandler) MergePullRequest(\n\tctx context.Context,\n\treq *mcp.CallToolRequest,\n\tp MergePullRequestParams,\n) (*mcp.CallToolResult, any, error)\n```\n\n```go\nfunc (h *ToolHandler) ReadFile(\n\tctx context.Context,\n\treq *mcp.CallToolRequest,\n\tp ReadFileParams,\n) (*mcp.CallToolResult, any, error)\n```\n\n```go\nfunc (h *ToolHandler) RefreshUserContext(\n\tctx context.Context,\n\treq *mcp.CallToolRequest,\n\t_ struct{},\n) (*mcp.CallToolResult, any, error)\n```\nRefreshUserContext refreshes the user context from Gitopia\n\n```go\nfunc (h *ToolHandler) RejectTransaction(\n\tctx context.Context,\n\treq *mcp.CallToolRequest,\n\tp RejectTransactionParams,\n) (*mcp.CallToolResult, any, error)\n```\nRejectTransaction cancels a previously held pending transaction.\n\n```go\nfunc (h *ToolHandler) ResolvePath(relativePath string) (string, error)\n```\nResolvePath resolves a relative path to an absolute workspace path\n\n```go\nfunc (h *ToolHandler) SearchCode(\n\tctx context.Context,\n\treq *mcp.CallToolRequest,\n\tp SearchCodeParams,\n) (*mcp.CallToolResult, any, error)\n```\n\n```go\nfunc (h *ToolHandler) SetActiveDAO(\n\tctx context.Context,\n\treq *mcp.CallToolRequest,\n\tp SetActiveDAOParams,\n) (*mcp.CallToolResult, any, error)\n```\nSetActiveDAO sets the active DAO for operations\n\n```go\nfunc (h *ToolHandler) SubmitDaoProposal(\n\tctx context.Context,\n\treq *mcp.CallToolRequest,\n\tp SubmitDaoProposalParams,\n) (*mcp.CallToolResult, any, error)\n```\n\n```go\nfunc (h *ToolHandler) SyncWithRemote(\n\tctx context.Context,\n\treq *mcp.CallToolRequest,\n\tp SyncWithRemoteParams,\n) (*mcp.CallToolResult, any, error)\n```\n\n```go\nfunc (h *ToolHandler) ToggleRepositoryForking(\n\tctx context.Context,\n\treq *mcp.CallToolRequest,\n\tp ToggleRepositoryForkingParams,\n) (*mcp.CallToolResult, any, error)\n```\n\n```go\nfunc (h *ToolHandler) UpdateBounty(\n\tctx context.Context,\n\treq *mcp.CallToolRequest,\n\tp UpdateBountyParams,\n) (*mcp.CallToolResult, any, error)\n```\n\n```go\nfunc (h *ToolHandler) UpdateDaoMembers(\n\tctx context.Context,\n\treq *mcp.CallToolRequest,\n\tp UpdateDaoMembersParams,\n) (*mcp.CallToolResult, any, error)\n```\n\n```go\nfunc (h *ToolHandler) UpdateFeatureBranch(\n\tctx context.Context,\n\treq *mcp.CallToolRequest,\n\tp UpdateFeatureBranchParams,\n) (*mcp.CallToolResult, any, error)\n```\n\n```go\nfunc (h *ToolHandler) UpdateIssue(\n\tctx context.Context,\n\treq *mcp.CallToolRequest,\n\tp UpdateIssueParams,\n) (*mcp.CallToolResult, any, error)\n```\n\n```go\nfunc (h *ToolHandler) VoteDaoProposal(\n\tctx context.Context,\n\treq *mcp.CallToolRequest,\n\tp VoteDaoProposalParams,\n) (*mcp.CallToolResult, any, error)\n```\n\n```go\nfunc (h *ToolHandler) WriteFile(\n\tctx context.Context,\n\treq *mcp.CallToolRequest,\n\tp WriteFileParams,\n) (*mcp.CallToolResult, any, error)\n```\n\n```go\ntype Toolset string\n```\nToolset groups tools by functional area. Tools in the \"core\" set are always registered. Other sets can be enabled via TOOLSETS env var.\n\n```go\nconst (\n\tToolsetCore     Toolset = \"core\"\n\tToolsetWorkflow Toolset = \"workflow\"\n)\n```\n\n```go\ntype TrustLevel int\n```\nTrustLevel represents the permission tier for tool access.\n\n```go\nconst (\n\tTrustReadOnly   TrustLevel = 1\n\tTrustLocalWrite TrustLevel = 2\n\tTrustChainWrite TrustLevel = 3\n)\n```\n\n```go\nfunc ParseTrustLevel(s string) TrustLevel\n```\nParseTrustLevel converts a string to a TrustLevel. Defaults to TrustChainWrite for backward compatibility.\n\n```go\nfunc (t TrustLevel) String() string\n```\nString returns the human-readable name of the trust level.\n\n```go\ntype UpdateBountyParams struct {\n\tBountyID uint64 `json:\"bounty_id\"`\n\tExpiry   int64  `json:\"expiry,omitempty\"`\n}\n```\n\n```go\ntype UpdateDaoMembersParams struct {\n\tDAO           string `json:\"dao,omitempty\" jsonschema:\"DAO name or address (alternative to group_id)\"`\n\tGroupID       uint64 `json:\"group_id,omitempty\" jsonschema:\"The cosmos group ID of the DAO\"`\n\tMemberUpdates []struct {\n\t\tAddress  string `json:\"address\"`\n\t\tWeight   string `json:\"weight\"`\n\t\tMetadata string `json:\"metadata,omitempty\"`\n\t} `json:\"member_updates\" jsonschema:\"List of member updates. Set weight to 0 to remove a member.\"`\n}\n```\n\n```go\ntype UpdateFeatureBranchParams struct {\n\tRepoPath      string          `json:\"repo_path\" jsonschema:\"Repository path relative to workspace (e.g. 'myrepo')\"`\n\tBranchName    string          `json:\"branch_name\"`\n\tFiles         []fs.FileChange `json:\"files\"`\n\tCommitMessage string          `json:\"commit_message\"`\n}\n```\n\n```go\ntype UpdateIssueParams struct {\n\tOwner           string   `json:\"owner\" jsonschema:\"Repository owner (username or DAO name)\"`\n\tName            string   `json:\"name\" jsonschema:\"Repository name\"`\n\tIssueIid        uint64   `json:\"issue_iid\" jsonschema:\"Issue number (IID)\"`\n\tToggleState     bool     `json:\"toggle_state,omitempty\" jsonschema:\"Toggle issue open/closed state\"`\n\tStateComment    string   `json:\"state_comment,omitempty\" jsonschema:\"Comment to add when toggling state\"`\n\tAddLabels       []uint64 `json:\"add_labels,omitempty\" jsonschema:\"Label IDs to add\"`\n\tRemoveLabels    []uint64 `json:\"remove_labels,omitempty\" jsonschema:\"Label IDs to remove\"`\n\tAddAssignees    []string `json:\"add_assignees,omitempty\" jsonschema:\"Usernames to assign\"`\n\tRemoveAssignees []string `json:\"remove_assignees,omitempty\" jsonschema:\"Usernames to unassign\"`\n}\n```\n\n```go\ntype VoteDaoProposalParams struct {\n\tProposalID uint64 `json:\"proposal_id\" jsonschema:\"The unique ID of the proposal to vote on\"`\n\tOption     string `json:\"option\" jsonschema:\"Vote option: yes, no, abstain, or no_with_veto\"`\n\tMetadata   string `json:\"metadata,omitempty\" jsonschema:\"Arbitrary metadata for the vote\"`\n\tExecTry    bool   `json:\"exec_try,omitempty\" jsonschema:\"If true, try to execute proposal after voting\"`\n}\n```\n\n```go\ntype WriteFileParams struct {\n\tPath    string `json:\"path\" jsonschema:\"File path relative to workspace root (e.g. 'myrepo/src/main.go')\"`\n\tContent string `json:\"content\" jsonschema:\"The content to write to the file.\"`\n}\n```\n\n","path":"github.com/gitopia/gitopia-mcp-server/internal/handler","name":"handler","synopsis":"","isRedistributable":true}
