-
Notifications
You must be signed in to change notification settings - Fork 0
Gl/improve tool discovery #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR refactors the tool registry and discovery system, replacing the old adapter-based architecture with a simpler, more direct approach. The changes consolidate tool registration into a new humcp package with a decorator-based system that auto-discovers tools at startup.
Key Changes
- New architecture: Removed the adapter layer (FastMCPFastAPIAdapter, RouteGenerator) in favor of a direct decorator-based tool registry with unified route generation
- Simplified tool registration: Tools now use
@tool()decorator fromsrc.humcp.decoratorwith automatic name generation from category and function name - Streamlined server creation: Consolidated server initialization into
src.humcp.server.create_app()with automatic tool discovery and both REST and MCP endpoint registration
Reviewed changes
Copilot reviewed 25 out of 26 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
src/humcp/registry.py |
New tool registry module with ToolRegistration dataclass and global registry |
src/humcp/decorator.py |
New @tool decorator for registering tools with automatic category detection |
src/humcp/routes.py |
New REST route generation with schema extraction from type hints |
src/humcp/server.py |
New unified app creation with automatic tool discovery and MCP integration |
src/humcp/__init__.py |
Empty init file for the new humcp package |
src/main.py |
Simplified entry point using create_app() |
src/tools/local/calculator.py |
Updated tool names from calculator_add to add (and similarly for other calculator tools) |
src/tools/local/local_file_system.py |
Updated import to use src.humcp.decorator |
src/tools/local/shell.py |
Updated import to use src.humcp.decorator |
src/tools/data/csv.py |
Updated import and tool names (e.g., csv_list_csv_files to list_csv_files) |
src/tools/data/pandas.py |
Updated import and tool names with pandas prefix removed |
src/tools/files/pdf_to_markdown.py |
Updated import to use src.humcp.decorator |
src/tools/search/tavily_tool.py |
Updated import and renamed from web_search to tavily_web_search |
src/tools/__init__.py |
Removed old decorator and registry (replaced by src/humcp/) |
src/adapter/ |
Removed entire adapter package (no longer needed) |
src/mcp_register.py |
Removed old MCP registration logic (replaced by server.create_app()) |
tests/humcp/test_models.py |
New tests for model generation from schemas |
tests/humcp/test_decorator.py |
New tests for the @tool decorator and registration |
tests/humcp/__init__.py |
Test package init file |
tests/adapter/ |
Removed old adapter tests (adapter removed) |
README.md |
Updated documentation to reflect new architecture and usage patterns |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 25 out of 26 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…covery' into gl/improve-tool-discovery
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
improve tool registry