mirror of
https://gitea.com/gitea/gitea-mcp.git
synced 2026-02-27 09:05:12 +00:00
This change makes index parameters more flexible by accepting both numeric and string values. LLM agents often pass issue/PR indices as strings (e.g., "123") since they appear as string identifiers in URLs and CLI contexts. The implementation: - Created `pkg/params` package with `GetIndex()` helper function - Updated 25+ tool functions across issue, pull, label, and timetracking operations - Improved error messages to say "must be a valid integer" instead of misleading "is required" - Added comprehensive tests for both numeric and string inputs Based on #122 by @jamespharaoh with review feedback applied (replaced custom `contains()` test helper with `strings.Contains`). Verified working in Claude Code. Fixes: https://gitea.com/gitea/gitea-mcp/issues/121 Fixes: https://gitea.com/gitea/gitea-mcp/issues/122 --------- Co-authored-by: James Pharaoh <james@pharaoh.uk> Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/131 Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: silverwind <me@silverwind.io> Co-committed-by: silverwind <me@silverwind.io>
12 KiB
12 KiB