Skip to content

Feature Request: Add output filtering and formatting options #44

@mobatmedia

Description

@mobatmedia

Summary

Add output filtering capabilities to control which fields are returned and how data is formatted.

Motivation

API responses often contain many fields, but users frequently only need a subset. Reducing output to relevant fields:

  • Reduces token usage when used with LLMs
  • Improves readability of results
  • Allows focusing on specific data for analysis

Proposed Implementation

Add three optional parameters to applicable tools:

fields parameter

  • Accepts a list of field names to include in output
  • Supports dot notation for nested fields (e.g., quote.price)
  • Special presets using @preset_name syntax:
    • @greeks - Delta, gamma, theta, vega, rho
    • @options_summary - Key options data fields
    • @options_quote - Price/volume quote data

output_format parameter

  • json (default) - Standard JSON output
  • csv - CSV format for tabular data
  • compact - Condensed single-line JSON

aggregate parameter

  • sum, avg, min, max, count - Aggregate numeric fields

Example Usage

fields: ["symbol", "strike", "@greeks"]
output_format: "csv"

Returns only symbol, strike, and greek values in CSV format.

Additional Context

This is particularly useful for options chain data where responses can be large but only specific fields are needed for analysis.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions