feat: add save_item_from_mcp functionality to core services
Co-authored-by: aider (openai/andrew/openrouter/google/gemini-2.5-pro) <aider@aider.chat>
This commit is contained in:
18
PLAN.md
18
PLAN.md
@@ -8,7 +8,7 @@
|
||||
- [x] 5. Add async wrappers for API use
|
||||
- [x] 6. Refactor CLI modes to use services (DONE)
|
||||
- [x] 7. Refactor REST API to use async services
|
||||
- [ ] 8. Refactor MCP tools to use services
|
||||
- [x] 8. Refactor MCP tools to use services
|
||||
- [x] 9. Create unified error handling
|
||||
- [ ] 10. Add integration tests
|
||||
- [ ] 11. Add performance optimization guidelines (partially done)
|
||||
@@ -155,22 +155,22 @@
|
||||
- Use common error handling with conversions to HTTP responses
|
||||
- Wrap synchronous service calls in `tokio::task::spawn_blocking`
|
||||
|
||||
## 8. Refactor MCP Tools to Use Services
|
||||
## 8. Refactor MCP Tools to Use Services (DONE)
|
||||
**Files:**
|
||||
- Change: `src/modes/server/mcp/tools.rs`
|
||||
- Change: `src/modes/server/mcp/tools.rs` (DONE)
|
||||
|
||||
**Functions:**
|
||||
- Change: `save_item` to use `item_service::save_item`
|
||||
- Change: `get_item` to use `item_service::get_item_full`
|
||||
- Change: `get_latest_item` to use `item_service::get_latest_item`
|
||||
- Change: `list_items` to use `item_service::list_items`
|
||||
- Change: `search_items` to use `item_service::search_items`
|
||||
- Change: `save_item` to use `item_service` (DONE)
|
||||
- Change: `get_item` to use `async_item_service` (DONE)
|
||||
- Change: `get_latest_item` to use `async_item_service` (DONE)
|
||||
- Change: `list_items` to use `async_item_service` (DONE)
|
||||
- Change: `search_items` to use `async_item_service` (DONE)
|
||||
|
||||
**Reason:** Remove duplication with REST API and CLI modes
|
||||
**Implementation:**
|
||||
- Replace current implementation with calls to core services
|
||||
- Keep only MCP protocol-specific logic
|
||||
- Use synchronous services directly (MCP is typically local/short-lived)
|
||||
- Use `async_item_service` wrappers for database operations
|
||||
- Standardize response format to match API/CLI
|
||||
|
||||
## 9. Create Unified Error Handling (DONE)
|
||||
|
||||
Reference in New Issue
Block a user