feat: add optional JSON output format for all tools#26
Merged
Conversation
Add `supports_json` parameter to the @endpoint decorator that auto-adds a `format` parameter to endpoints. When format="json" is passed, endpoints return structured JSON instead of text. Changes: - Enhanced @endpoint decorator with supports_json=True option - Auto-adds format parameter with enum ["text", "json"] - Implemented JSON output for 5 key endpoints: - get_player_summary: Player profile data - get_friend_list: Friends with timestamps - get_owned_games: Games with playtime stats - get_player_achievements: Achievements with unlock times - get_app_details: App metadata, pricing, platforms - Text output remains unchanged (backward compatible) - JSON output uses consistent snake_case field names 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Owner
Author
Code Review - JSON Output FormatVerdict: ✅ ApproveStrengths:
Minor Notes (non-blocking):
Review by @agent-ml-python-mcp-expert |
All JSON error responses now consistently return {"error": msg}
without extra fields like empty arrays or IDs.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
supports_jsonparameter to the@endpointdecorator that auto-adds aformatparameterformat="json"is passed, endpoints return structured JSON instead of human-readable textChanges
@endpointdecorator inbase.pyto supportsupports_json=Trueoptionformatparameter with enum["text", "json"]and default"text"get_player_summary: Player profile data with status/visibility enumsget_friend_list: Friends array with steam_id and friend_since timestampsget_owned_games: Games array with playtime stats and metadataget_player_achievements: Achievement list with unlock times and completion statsget_app_details: Full app metadata including pricing, platforms, genresTesting
Checklist from Issue
formatparameter available on key endpointsCloses #14
🤖 Generated with Claude Code