mirror of
https://gitea.com/gitea/gitea-mcp.git
synced 2025-08-23 14:23:05 +00:00
feat: add GetDirContent tool for retrieving directory entries (#53)
### 🚀 What's Changed This PR introduces a new MCP tool `get_dir_content` that allows users to retrieve a list of entries (files and subdirectories) from a specified directory in a Gitea repository. ### ✨ Features Added - **New Tool**: `GetDirContent` tool for directory listing functionality - **Tool Registration**: Properly registered as a read operation in the MCP server - **Parameter Validation**: Comprehensive input validation for required parameters - **Error Handling**: Robust error handling with descriptive error messages ### 🔧 Technical Details - **Tool Name**: `get_dir_content` - **Required Parameters**: - `owner`: Repository owner - `repo`: Repository name - `ref`: Branch, tag, or commit reference - `filePath`: Directory path to list ### 📁 Files Modified - file.go: Added tool definition, registration, and handler function ### 🎯 Use Cases This tool enables users to: - Browse repository directory structures - List files and folders in specific directories - Navigate repository contents programmatically - Support file management workflows in MCP clients Reviewed-on: https://gitea.com/gitea/gitea-mcp/pulls/53 Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: ZRE <chy853@gmail.com> Co-committed-by: ZRE <chy853@gmail.com>
This commit is contained in:
@@ -194,6 +194,7 @@ The Gitea MCP Server supports the following tools:
|
||||
| list_tags | Tag | List all tags in a repository |
|
||||
| list_repo_commits | Commit | List all commits in a repository |
|
||||
| get_file_content | File | Get the content and metadata of a file |
|
||||
| get_dir_content | File | Get a list of entries in a directory |
|
||||
| create_file | File | Create a new file |
|
||||
| update_file | File | Update an existing file |
|
||||
| delete_file | File | Delete a file |
|
||||
|
Reference in New Issue
Block a user