Skip to content

Add a 2 or 4 space indent option to process_json - #20

Merged
kushagarwal2910-lang merged 1 commit into
github-community-gitam:mainfrom
SakarPaisen:feat/json-indent-option-2
Oct 22, 2026
Merged

kushagarwal2910-lang merged 1 commit into
github-community-gitam:mainfrom
SakarPaisen:feat/json-indent-option-2

Conversation

@SakarPaisen

Copy link
Copy Markdown
Contributor

Closes #2

What changed

  • \process_json\ in \src/mcp_tools_lab/tools/json_tool.py\ takes a typed \indent\ argument (default \2). Only \2\ and \4\ are accepted; any other value raises a readable \ValueError. \indent\ is validated for every action, but only formatted output is affected, so existing \minify\ and \�alidate\ behavior is unchanged.
  • Docstring updated; \docs/tool-guide.md\ signature and wording updated.
  • Existing JSON semantics (keys, numbers, separators, error reporting) are untouched.

Tests

Added to \ ests/test_json_tool.py: default two-space output, explicit \indent=2, \indent=4, nested JSON at both indents, and invalid values (\3, \

@kushagarwal2910-lang
kushagarwal2910-lang merged commit 6638f5d into github-community-gitam:main Oct 22, 2026
4 checks passed
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.

Choose JSON indentation

2 participants