Feat/multi asset screening#19
Conversation
Implement direct symbol lookup for indexes and comprehensive market regime analysis: New Features: - lookup_symbols: Direct ticker lookup using symbols.tickers API - Supports indexes (TVC:SPX, OMXSTO:OMXS30), stocks, ETFs - Returns ATH, ATL, 52-week highs/lows - Default columns optimized for market analysis - Max 100 symbols per request - market_indexes preset: 13 global indexes - US: SPX, DJI, IXIC, RUT - Europe: UKX, DAX, CAC, IBEX35 - Asia: NI225, HSI, SHCOMP, SENSEX - Nordic: OMXS30 - Pre-configured with 16 analysis columns Updates: - Preset interface now supports both filters (screening) and symbols (lookup) - Updated tests to handle symbol-based presets - All 69 tests passing Use Cases: - Market regime analysis (are we at ATH?) - Index comparison across regions - Portfolio benchmark analysis - Direct symbol data retrieval 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Update README.md with lookup_symbols tool documentation and examples - Add market_indexes preset to presets table (7 presets total) - Create comprehensive market_indexes section in docs/presets.md - Document 13 global indexes (US, Europe, Asia-Pacific, Nordic) - Add market regime analysis use cases and examples - Include drawdown calculation, bull/bear identification, risk assessment Verified all requested indexes are included and fetchable: - TVC:IXIC (Nasdaq Composite) - OMXSTO:OMXS30 (OMX Stockholm 30) - TVC:NI225 (Nikkei 225) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Pull Request Review: Feat/multi asset screeningOverviewThis PR adds a new StrengthsCode Quality
Documentation
Testing
Observations & Suggestions1. Code Duplication (Minor)Location: src/tools/screen.ts:366-445 The Impact: Low - current implementation is fine 2. Missing Input ValidationLocation: src/tools/screen.ts:403 The Impact: Low - MCP SDK validates schema, but defensive programming is good practice 3. Cache Key ConsiderationLocation: src/tools/screen.ts:382 The cache key could benefit from sorting symbols for better cache hit rates when the same symbols are requested in different orders. Impact: Low - current code works fine 4. Preset Interface DesignLocation: src/resources/presets.ts:11-16 The Impact: Low - all current presets are valid 5. Missing Integration TestNo integration test for the Impact: Medium - would improve confidence in the new feature Security
Performance
SummaryThis is a high-quality PR that:
Recommendation: APPROVE with minor suggestionsThe code is production-ready. The suggestions above are optional improvements that could be addressed in follow-up PRs. The new feature is well-implemented and will be valuable for market analysis use cases. Great work! |
|
@claude can you work on integration test for |
|
Claude finished @bearmug's task —— View job Integration test for
|
Implements integration tests covering: - Input validation (empty arrays, max symbols constraint) - Single and multiple symbol lookups - Custom column support - Caching behavior verification - Rate limiting integration - Response formatting and null value handling - Market regime analysis use case with multiple indexes This addresses the suggestion from PR review to add integration tests for the lookup_symbols tool functionality. Co-authored-by: Pavel Fadeev <bearmug@users.noreply.github.com>
Pull Request Review: Multi-Asset Screening & Symbol LookupSummaryThis PR adds a valuable new Strengths1. Well-Designed API
2. Comprehensive Test Coverage
3. Consistent Architecture
Issues & RecommendationsCritical Issues1. Type Safety Issue in Presets (High Priority)Location: src/resources/presets.ts:10-15 The export interface Preset {
name: string;
description: string;
filters?: Array<{...}>; // Optional
symbols?: string[]; // Optional
// ...
}Problem: Both could be undefined, or both could be defined simultaneously. Recommendation: Use a discriminated union: export type Preset = {
name: string;
description: string;
markets?: string[];
sort_by?: string;
sort_order?: "asc" | "desc";
columns?: string[];
} & (
| { type: 'filter'; filters: Array<{...}> }
| { type: 'lookup'; symbols: string[] }
);2. Missing Preset Handler in PresetsTool (High Priority)Location: src/resources/presets.ts (PresetsTool class - not visible in diff) The PR doesn't show how
Action Required: Check if PresetsTool needs updates to route symbol-based presets to Medium Priority Issues3. Inconsistent Error MessagesLocation: src/tools/screen.ts:374, 378 Error messages use "symbol" (singular) vs "symbols" (plural) inconsistently: throw new Error("At least one symbol is required"); // singular
throw new Error("Maximum 100 symbols allowed"); // pluralRecommendation: Be consistent: "At least one symbol is required" could be "symbols array cannot be empty" or keep both singular. 4. Cache Key Collision RiskLocation: src/tools/screen.ts:382 const cacheKey = JSON.stringify({ type: "lookup", symbols, columns: inputColumns });Issue: If symbols are in different order, they get different cache keys even though results would be identical:
Recommendation: Sort symbols before creating cache key: const cacheKey = JSON.stringify({
type: "lookup",
symbols: [...symbols].sort(),
columns: inputColumns
});5. Documentation AccuracyLocation: docs/presets.md:96 Documentation says "As of October 2025" but we're in 2025 (and this is likely meant to be 2024 or should be removed as it will quickly become outdated). Recommendation: Either use relative terms ("As of this writing") or remove temporal references entirely. Low Priority / Nice to Have6. Test Mock IsolationLocation: src/tests/lookup.test.ts Tests use shared mock instances across all tests, which could cause test interdependencies if mocks aren't properly reset. Recommendation: Consider using 7. Documentation EnhancementThe
Note: The docs do mention these points, but inline code examples in the preset description would help. Performance ConsiderationsPositive
Potential Concern
Security ConsiderationsNo Critical Issues FoundPositive aspects:
Minor note: Consider validating symbol format (e.g., regex for valid ticker formats) to catch typos early, but this is optional as the API will handle invalid symbols gracefully. Test Coverage AssessmentExcellent Coverage (90%+)The new
Missing coverage (acceptable for this PR):
Code QualityStrengths
Minor Style Notes
RecommendationApprove with Minor Changes Required Must Fix Before Merge:
Should Fix Before Merge:
Nice to Have (Can be separate PR):
Overall AssessmentThis is a high-quality PR that adds meaningful functionality for market analysis. The implementation is solid, tests are comprehensive, and documentation is thorough. The identified issues are mostly minor and can be addressed quickly. Great work on:
Generated with Claude Code |
No description provided.