Skip to content

Conversation

@mobatmedia
Copy link

Summary

This PR adds two new features:

  1. Options Chain Snapshot Tool - Resolves Feature Request: Add options chain snapshot tool #43
  2. Output Filtering Support - Resolves Feature Request: Add output filtering and formatting options #44

Changes

New Tool: list_snapshot_options_chain

  • Retrieves options chain data with greeks from the Massive API
  • Supports filtering by expiration date, strike price, and option type
  • Returns comprehensive options data including delta, gamma, theta, vega

Output Filtering Parameters

Added three optional parameters to applicable tools:

  • fields: Select specific fields to include in output
    • Supports dot notation for nested fields
    • Preset support with @preset_name syntax:
      • @greeks - Delta, gamma, theta, vega, rho
      • @options_summary - Key options data fields
      • @options_quote - Price/volume quote data
  • output_format: Control output format (json, csv, compact)
  • aggregate: Aggregate numeric fields (sum, avg, min, max, count)

Files Changed

  • src/mcp_massive/server.py - New tool and output filtering integration
  • src/mcp_massive/filters.py - New module for field presets and filtering logic
  • src/mcp_massive/formatters.py - New formatters for CSV, compact, and filtered JSON
  • tests/test_filters.py - Comprehensive test suite (21 tests)
  • README.md - Documentation updates

Test Plan

  • Added 21 unit tests for filters module
  • All existing tests pass
  • Manually tested options chain retrieval
  • Verified output filtering with various field combinations

🤖 Generated with Claude Code

mobatmedia and others added 6 commits December 17, 2025 11:26
- Add list_snapshot_options_chain tool for options chain data with greeks
- Add filters.py module with field presets (greeks, options_summary, options_quote)
- Add output filtering support (fields, output_format, aggregate parameters)
- Add json_to_csv_filtered, json_to_compact, json_to_json_filtered formatters
- Add _apply_output_filtering helper function
- Add comprehensive test suite for filters module (21 tests)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
The massive client's list_snapshot_options_chain() only accepts
underlying_asset and params arguments. Filter parameters must be
passed through the params dict with dot notation for range filters.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
The API returns nested data (details.strike_price) which gets flattened
to details_strike_price. Updated presets to use correct flattened names
so strike_price and contract_type are included in output.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Update installation examples to use v0.7.0
- Add list_snapshot_options_chain to Available Tools
- Document output filtering parameters and field presets

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Options presets use flattened field names (e.g., details_ticker,
greeks_delta) not simplified names.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.

Feature Request: Add output filtering and formatting options Feature Request: Add options chain snapshot tool

1 participant