Skip to content

P12-T2: Add Tool Parameter Frequency Analysis#54

Merged
SoundBlaster merged 8 commits into
mainfrom
feature/P12-T2-tool-parameter-frequency-analysis
Feb 16, 2026
Merged

P12-T2: Add Tool Parameter Frequency Analysis#54
SoundBlaster merged 8 commits into
mainfrom
feature/P12-T2-tool-parameter-frequency-analysis

Conversation

@SoundBlaster

Copy link
Copy Markdown
Owner

Description

Adds opt-in tool parameter frequency analysis to the XcodeMCPWrapper Web UI. When capture_params: true is set in the metrics config, the wrapper records the sorted key names (never values) of each tool call's arguments object. A new API endpoint and expandable dashboard UI show the most common parameter key combinations per tool.

Key changes:

  • WebUIConfig: new capture_params flag (default False)
  • MetricsCollector: record_param_keys() / get_param_patterns() with in-memory dict storage
  • SharedMetricsStore: new param_patterns SQLite table with UPSERT; record_param_keys() / get_param_patterns()
  • server.py: new GET /api/analytics/param-patterns?tool=<name>&top_n=10 endpoint
  • __main__.py: extracts argument keys from MCPRequest.params.arguments when flag enabled
  • dashboard.js: expandable chevron rows in the Per-Tool Latency table; fetches patterns on demand
  • dashboard.css: styles for toggle button and param patterns sub-table
  • Follow-up task FU-P12-T2-1 added to workplan: fix stacking click listeners in updateLatencyTable

Type of Change

  • New feature

Quality Gates

  • make test - All tests pass with ≥90% coverage (457 passed, 95.95% coverage)
  • make lint - No linting errors (ruff check src/ clean)
  • make format - Code is properly formatted
  • make typecheck - Type checking passes (mypy src/ clean, 13 files)
  • make doccheck - Documentation is synced with DocC (if docs changed)

Documentation Sync

  • Documentation changes are synced with DocC catalog (or N/A) — no docs/ files changed

Testing

  • Added/updated tests for new functionality
    • 8 tests: TestParamPatterns in test_metrics.py
    • 6 tests: param pattern methods in test_shared_metrics.py
    • 4 tests: TestParamPatternsEndpoint in test_server.py
    • 2 tests: capture_params config flag in test_config.py
  • All tests pass locally
  • Manually tested the changes

Checklist

  • Code follows the project's style guidelines
  • Self-review completed
  • Comments added for complex code
  • Documentation updated (if needed)
  • No new warnings generated
  • PR title is descriptive

@SoundBlaster SoundBlaster merged commit b2bcd55 into main Feb 16, 2026
9 checks passed
@SoundBlaster SoundBlaster deleted the feature/P12-T2-tool-parameter-frequency-analysis branch February 16, 2026 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant