Rename the fork from gitea-mcp to gitea-mcp-extended to reflect the significantly expanded tool coverage (299 vs upstream's 93 tools). - Rename Go module path and all import references - Rename binary to gitea-mcp-extended in Makefile, Dockerfile, .gitignore - Point .goreleaser.yaml gitea_urls to git.lethalbits.com - Replace release-tag workflow with goreleaser + Generic Package Registry publishing - Replace release-nightly workflow with cross-platform build + nightly package publishing - Update CLAUDE.md project description and tool count
29 lines
595 B
Go
29 lines
595 B
Go
package to
|
|
|
|
import (
|
|
"encoding/json"
|
|
"fmt"
|
|
|
|
"git.lethalbits.com/lethalbits/gitea-mcp-extended/pkg/log"
|
|
"github.com/mark3labs/mcp-go/mcp"
|
|
)
|
|
|
|
type textResult struct {
|
|
Result any
|
|
}
|
|
|
|
func TextResult(v any) (*mcp.CallToolResult, error) {
|
|
result := textResult{v}
|
|
resultBytes, err := json.Marshal(result)
|
|
if err != nil {
|
|
return nil, fmt.Errorf("marshal result err: %v", err)
|
|
}
|
|
log.Debugf("Text Result: %s", string(resultBytes))
|
|
return mcp.NewToolResultText(string(resultBytes)), nil
|
|
}
|
|
|
|
func ErrorResult(err error) (*mcp.CallToolResult, error) {
|
|
log.Errorf(err.Error())
|
|
return nil, err
|
|
}
|