Skip to content

Add archived parameter to filter out old markets from 2020-2021#18

Open
berlinbra wants to merge 1 commit into
update-to-gamma-apifrom
fix-archived-filter
Open

Add archived parameter to filter out old markets from 2020-2021#18
berlinbra wants to merge 1 commit into
update-to-gamma-apifrom
fix-archived-filter

Conversation

@berlinbra
Copy link
Copy Markdown
Owner

This PR adds the missing archived parameter handling that ChatGPT identified as the key fix for the outdated market listings issue.

What was missing

Your update-to-gamma-api branch already had the Gamma API integration, but it was missing the crucial archived parameter that filters out old markets from 2020-2021.

Changes in this PR

  1. Added archived parameter to the tool schema

    • Added to the list-markets tool properties
    • Set default value to false to exclude archived markets
  2. Implemented archived parameter handling

    • Added logic to handle the archived parameter in the list-markets tool
    • Defaults to archived=false when not specified
    • Included in both the main request and fallback minimal parameters

Key code changes

# In tool schema
"archived": {
    "type": "boolean",
    "description": "Filter by archived markets (set to false to exclude old markets)",
    "default": False,
}

# In handle_call_tool
if arguments.get("archived") is not None:
    params["archived"] = arguments.get("archived")
else:
    # Default to excluding archived markets
    params["archived"] = False

# In fallback minimal params
minimal_params = {
    "active": True,
    "archived": False,  # Key addition
    "limit": params["limit"]
}

Expected result

With this fix, the API should now return current markets instead of the same 5 outdated listings from 2020-2021.

- Add archived parameter to list-markets tool schema
- Set archived=false by default to exclude old markets
- Handle archived parameter in API requests
- Update fallback minimal params to include archived=false
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