|
1 | 1 | # CHANGELOG |
2 | 2 |
|
| 3 | +## v0.10.0 (2025-11-07) |
| 4 | + |
| 5 | +### Documentation |
| 6 | + |
| 7 | +- **mcp**: Comprehensive documentation enhancements and template externalization (#5) |
| 8 | + ([#78](https://github.com/dougborg/stocktrim-openapi-client/pull/78), |
| 9 | + [`d5ee08d`](https://github.com/dougborg/stocktrim-openapi-client/commit/d5ee08d4666d41a5d228d05b67d01a5a62230955)) |
| 10 | + |
| 11 | +* test(mcp): add comprehensive tests for structured logging |
| 12 | + |
| 13 | +Add test coverage for logging configuration and observability decorators. |
| 14 | + |
| 15 | +Tests added: - test_logging_config.py (10 tests): * Configuration with different formats |
| 16 | +(console, JSON) * Configuration with different log levels * Logger instance creation \* |
| 17 | +Environment variable handling * Invalid configuration handling |
| 18 | + |
| 19 | +- test_observability.py (15 tests): * @observe_tool decorator functionality \* |
| 20 | + @observe_service decorator functionality * Success and failure scenarios * Timing |
| 21 | + measurements * Parameter filtering * Function metadata preservation * Exception |
| 22 | + propagation |
| 23 | + |
| 24 | +All 25 tests pass successfully. |
| 25 | + |
| 26 | +This provides coverage for the structured logging implementation added in commit |
| 27 | +925a19f. |
| 28 | + |
| 29 | +- fix(test): replace time.sleep with asyncio.sleep in async tests |
| 30 | + |
| 31 | +Address code review feedback: use asyncio.sleep() instead of time.sleep() in async test |
| 32 | +functions to properly test timing without blocking the event loop. |
| 33 | + |
| 34 | +Changes: - Replace time.sleep() with asyncio.sleep() in timing tests - Remove |
| 35 | +AsyncMock() calls that don't yield control - Import asyncio instead of time module |
| 36 | + |
| 37 | +Fixes PR review comments from Copilot. |
| 38 | + |
| 39 | +- test: add comprehensive tests for forecast management tools |
| 40 | + |
| 41 | +Add 13 new unit tests covering the two new forecast management workflow tools: - |
| 42 | +forecasts_update_and_monitor (5 tests) - forecasts_get_for_products (8 tests) |
| 43 | + |
| 44 | +Tests cover: - Trigger-only and wait-for-completion modes - Progress monitoring and |
| 45 | +timeout handling |
| 46 | + |
| 47 | +- Error scenarios and validation - Filtering, sorting, and priority indicators - Empty |
| 48 | + results and summary statistics |
| 49 | + |
| 50 | +Also fix DTO field name issues in forecast_management.py: - Remove references to |
| 51 | +non-existent supplier_name field - Use correct field names (order_quantity, |
| 52 | +safety_stock_level) - Add pytest timeout marker for long-running test |
| 53 | + |
| 54 | +All 235 tests now passing. |
| 55 | + |
| 56 | +- fix: remove unused product_name assignment |
| 57 | + |
| 58 | +Address Copilot review comment - remove unnecessary product_name assignment that was |
| 59 | +immediately overwritten. Now correctly uses product_code as the display name since the |
| 60 | +DTO doesn't have a product_description field. |
| 61 | + |
| 62 | +- docs(mcp): enhance documentation and externalize markdown templates (#5) |
| 63 | + |
| 64 | +This commit addresses issue #5 by significantly improving MCP server documentation for |
| 65 | +AI agent success. Changes include: |
| 66 | + |
| 67 | +## Documentation Improvements |
| 68 | + |
| 69 | +1. **Comprehensive Server Instructions** (server.py) - Expanded FastMCP instructions |
| 70 | + from 6 lines to 200+ lines - Added tool categorization (Foundation vs Workflow) - |
| 71 | + Included 5 complete workflow examples: * Inventory Reordering (automated & manual |
| 72 | + approaches) * Forecast Management (update, monitor, analyze) * Supplier Onboarding |
| 73 | + (workflow vs step-by-step) * Product Configuration (lifecycle management) * Customer |
| 74 | + Order Fulfillment (complete flow) - Added best practices for tool selection - |
| 75 | + Documented error handling patterns - Included observability and performance notes |
| 76 | + |
| 77 | +1. **Complete Workflow Examples** (docs/mcp-server/examples.md) - Real-world scenarios |
| 78 | + with full request/response flows - When-to-use guidance for each workflow - Trade-off |
| 79 | + analysis for different approaches - Advanced patterns and troubleshooting - Error |
| 80 | + handling best practices - Performance optimization tips |
| 81 | + |
| 82 | +## Code Quality Improvements |
| 83 | + |
| 84 | +3. **Externalized Markdown Templates** - Created templates/ directory for response |
| 85 | + templates - Extracted 6 markdown templates from forecast_management.py - Added |
| 86 | + template loader utility with format support - Cleaner code with better |
| 87 | + maintainability - Templates can now be edited without touching Python code |
| 88 | + |
| 89 | +## Technical Details |
| 90 | + |
| 91 | +- Templates use Python .format() for variable substitution - Template loader provides |
| 92 | + FileNotFoundError for missing templates - All existing tests pass without modification |
| 93 | + \- Server imports successfully with new structure |
| 94 | + |
| 95 | +* docs(mcp): enhance workflow tool docstrings and complete tools.md (#5) |
| 96 | + |
| 97 | +This commit completes issue #5 by enhancing workflow tool documentation with |
| 98 | +comprehensive docstrings and updating tools.md to include workflow tools. |
| 99 | + |
| 100 | +## Enhanced Workflow Tool Docstrings |
| 101 | + |
| 102 | +Updated all 6 workflow tool docstrings with: |
| 103 | + |
| 104 | +1. **review_urgent_order_requirements** - How it works section - Common use cases |
| 105 | + (weekly reorders, urgent restocking, etc.) - Typical workflow with step-by-step |
| 106 | + guidance - Enhanced example with detailed response structure - See Also section |
| 107 | + linking to examples.md |
| 108 | + |
| 109 | +1. **generate_purchase_orders_from_urgent_items** - How it works section - Common use |
| 110 | + cases and best practices - Important notes about draft status and review requirements |
| 111 | + \- Enhanced example showing multiple POs - See Also section with related tools |
| 112 | + |
| 113 | +1. **create_supplier_with_products** - How it works with transactional approach |
| 114 | + explanation - Common use cases for supplier onboarding scenarios - Best practices for |
| 115 | + verification and error handling - Advantages over manual approach comparison - |
| 116 | + Enhanced example with 3 product mappings |
| 117 | + |
| 118 | +1. **configure_product** - How it works section - Common use cases (discontinuation, |
| 119 | + seasonal activation, etc.) - Best practices for lifecycle management - Field mappings |
| 120 | + explanation (discontinue -> discontinued) - Multiple examples (discontinuing and |
| 121 | + activating products) |
| 122 | + |
| 123 | +## Updated tools.md |
| 124 | + |
| 125 | +Added comprehensive workflow tools section including: - Tool categories explanation |
| 126 | +(Foundation vs Workflow) - When to use which type of tool - Detailed documentation for |
| 127 | +all 7 workflow tools: * Forecast management tools (3) * Urgent order management tools |
| 128 | +(2) * Supplier management tools (1) |
| 129 | + |
| 130 | +- Product management tools (1) - Links to examples.md for complete workflows - Parameter |
| 131 | + documentation with ranges and defaults |
| 132 | + |
| 133 | +## Documentation Structure |
| 134 | + |
| 135 | +Each enhanced docstring now includes: - Brief description - "How It Works" section - |
| 136 | +"Common Use Cases" section - "Best Practices" section (where applicable) - Enhanced |
| 137 | +examples with realistic data - "See Also" section with links to: * Complete workflows in |
| 138 | +examples.md * Related tools * Foundation tools for comparison |
| 139 | + |
| 140 | +This makes the tools self-documenting and provides clear guidance for AI agents on when |
| 141 | +and how to use each tool. |
| 142 | + |
| 143 | +- refactor: extract magic numbers to named constants |
| 144 | + |
| 145 | +Address Copilot review comments by defining: - MAX_RESPONSE_SIZE_BYTES = 400_000 - |
| 146 | +ESTIMATED_CHARS_PER_FORECAST_ITEM = 500 |
| 147 | + |
| 148 | +This improves maintainability and makes token budget thresholds easy to adjust. |
| 149 | + |
| 150 | +- fix: address Copilot review comments |
| 151 | + |
| 152 | +* Extract priority threshold constants (HIGH=7, MEDIUM=14 days) - Remove unnecessary |
| 153 | + comments from test file - Fix markdown formatting for environment variables |
| 154 | + |
| 155 | +______________________________________________________________________ |
| 156 | + |
| 157 | +Co-authored-by: Doug Borg <dougborg@dougborg.org> |
| 158 | + |
| 159 | +Co-authored-by: Claude <noreply@anthropic.com> |
| 160 | + |
| 161 | +### Features |
| 162 | + |
| 163 | +- **mcp**: Implement Phase 3 MCP resources for discovery (#19) |
| 164 | + ([#79](https://github.com/dougborg/stocktrim-openapi-client/pull/79), |
| 165 | + [`ccaa05c`](https://github.com/dougborg/stocktrim-openapi-client/commit/ccaa05c92b7c69cc2a3c720541df1a993c3de162)) |
| 166 | + |
| 167 | +* feat(mcp): implement Phase 3 MCP resources for discovery |
| 168 | + |
| 169 | +Add 9 MCP resources that enable AI agents to explore StockTrim data without making tool |
| 170 | +calls, improving context gathering and discovery. |
| 171 | + |
| 172 | +Resources Implemented: |
| 173 | + |
| 174 | +Foundation Resources (6): - stocktrim://products/{product_code} - Product details - |
| 175 | +stocktrim://products/catalog - Product catalog (50 item limit) - |
| 176 | +stocktrim://customers/{customer_code} - Customer details - |
| 177 | +stocktrim://suppliers/{supplier_code} - Supplier information - |
| 178 | +stocktrim://locations/{location_code} - Location details - |
| 179 | +stocktrim://inventory/{location_code}/{product_code} - Stock levels |
| 180 | + |
| 181 | +Report Resources (3): - stocktrim://reports/inventory-status?days_threshold=30 - Low |
| 182 | +stock items - stocktrim://reports/urgent-orders - Items needing reorder (< 7 days) - |
| 183 | +stocktrim://reports/supplier-directory - Supplier directory |
| 184 | + |
| 185 | +Key Implementation Details: - All resources return JSON for LLM consumption - Proper |
| 186 | +error handling with ResourceError for not found cases - Service layer reuse via |
| 187 | +dependency injection - UNSET handling for optional API fields - Token budget management |
| 188 | +(30-50 item limits on lists) - Client-side filtering for order plan queries (API |
| 189 | +limitation) - Inventory resource uses product-level stock (no GET endpoint) |
| 190 | + |
| 191 | +Testing: - 24 comprehensive unit tests for all resources - All 267 tests passing - Test |
| 192 | +coverage for success cases, not found errors, and edge cases |
| 193 | + |
| 194 | +Documentation: - Updated server.py instructions with resource documentation - Organized |
| 195 | +into Foundation and Report categories - Examples of resource usage in common workflows |
| 196 | + |
| 197 | +🤖 Generated with [Claude Code](https://claude.com/claude-code) |
| 198 | + |
| 199 | +Co-Authored-By: Claude <noreply@anthropic.com> |
| 200 | + |
| 201 | +- fix: address copilot review comments for resources |
| 202 | + |
| 203 | +* Remove default value from context parameter in inventory_status_report - Reorder |
| 204 | + parameters to put context first (required param before optional) - Update docstring to |
| 205 | + specify "50 items" limit in products catalog resource |
| 206 | + |
| 207 | +Addresses review comments from PR #79 |
| 208 | + |
| 209 | +______________________________________________________________________ |
| 210 | + |
| 211 | +Co-authored-by: Doug Borg <dougborg@apple.com> |
| 212 | + |
| 213 | +Co-authored-by: Claude <noreply@anthropic.com> |
| 214 | + |
3 | 215 | ## v0.9.0 (2025-11-07) |
4 | 216 |
|
| 217 | +### Chores |
| 218 | + |
| 219 | +- **release**: Mcp v0.9.0 |
| 220 | + ([`1a2659e`](https://github.com/dougborg/stocktrim-openapi-client/commit/1a2659e5a4c2db310b05decef027b64a626e8d63)) |
| 221 | + |
5 | 222 | ### Features |
6 | 223 |
|
7 | 224 | - **mcp**: Complete Phase 2 workflow tools with lifecycle and enhanced supplier |
|
0 commit comments