/json Command

The /json command provides tools to manipulate JSON strings.

Available Subcommands

/json beautify

Formats and beautifies a JSON string by adding indentation and line breaks.

Usage

/json beautify input: <JSON string>

Options

OptionDescriptionRequiredPlatform
inputThe JSON string to formatYesDiscord (parameter), Slack (directly after action)

Example

/json beautify input: {"name":"John","age":30,"city":"New York"}

/json validate

Checks if a JSON string is valid and well-formed.

Usage

/json validate input: <JSON string>

Options

OptionDescriptionRequiredPlatform
inputThe JSON string to validateYesDiscord (parameter), Slack (directly after action)

Example

/json validate input: {"name":"John","age":30,"city":"New York"}

/json clean

Cleans a JSON string by removing unwanted characters.

Usage

/json clean input: <JSON string>

Options

OptionDescriptionRequiredPlatform
inputThe JSON string to cleanYesDiscord (parameter), Slack (directly after action)

Example

/json clean input: "{\n  \"name\": \"John\",\n  \"age\": 30\n}"

Platform-Specific Implementation

Discord Implementation

  • Commands use Discord’s subcommand system with named parameters (e.g., input:)
  • Responses appear as embeds in the channel where the command is invoked
  • Formatting is preserved in code blocks with syntax highlighting
  • Large JSON outputs may be truncated with an indicator

Slack Implementation

  • Commands use a simpler format where input follows directly after the action
  • Responses are shown with formatted blocks showing the input and output
  • For very large JSON, output may be uploaded as a file attachment
  • The command supports help functionality by simply typing /json

Use Cases

  • Format JSON to make it more readable
  • Verify the validity of a JSON string
  • Clean poorly formatted JSON or remove escape characters
  • Share clean JSON code in Discord or Slack conversations
  • Extract JSON from logs by cleaning unwanted characters

Notes

  • Very long JSON strings may be truncated in the display or provided as file attachments
  • The command works with nested JSON objects and arrays