Back to the catalogue

JSON Tools

Format, query, and diff JSON — with actions and triggers

Install in Astra

In Astra, open Plugins and search for:

json-tools

Don’t have Astra yet? Get Astra

Details

Updated
2026-08-19
License
MIT
Status
Grandfathered until 2026-12-15 06:00 UTC

Being listed means these bytes were published by the repository shown and passed the registry’s automated checks. It is not a sandbox, not a security review, and not an endorsement.

About

JSON Tools

Format, query and diff JSON — in conversation and in commands.

What it does

Three things the assistant can do for you in a conversation:

  • json_format — pretty-print a JSON string at a chosen indent, or tell you precisely where it is malformed.
  • json_query — pull a value out with a dot-path such as data.users[0].name.
  • json_diff — compare two JSON documents and list what was added, removed and changed, path by path.

And one "JSON Transform" action for the command editor, which does format, minify, sort keys or extract path on a value from an earlier step and can store the result in a variable. Sorting keys is the useful one for commands: two documents that differ only in key order stop looking different.

There is also an "Invalid JSON Detected" trigger whose payload carries the offending text and a source label. Note the honest bit: this trigger is declared so a command can subscribe to it, but nothing in this plugin fires it today — a command wired to it will never run until some future version does. It is here as a worked example of a declared trigger type, not as a working alarm.

What it needs

  • Node.js 18 or newer on the machine running Astra. This is a TypeScript plugin; Astra does not ship a Node runtime, so the bundle declares runtimes = ["node"] and the daemon refuses to start it if node is missing rather than failing halfway.

No network, no files outside its own directory, no account.

Capabilities it asks for, and why

CapabilityWhat it allowsWhy this plugin asks
toolsAstra's assistant may call the plugin during a conversationThe three json_* tools
actionsThe plugin contributes steps to the command editor"JSON Transform"
triggersThe plugin can start your commands"Invalid JSON Detected" (declared; see above)

Text you pass to a tool is processed inside the plugin process and returned. It is not written to disk and not sent anywhere.

Configuration

SettingDefaultMeaning
Default Indent2Spaces used by format and sort keys when no indent is given

Build it yourself

cd examples/json-tools
# This example needs astra-plugin-sdk 0.5.0, which is not on npm yet, so point
# resolution at the SDK in this checkout — exactly what CI does:
#   (cd ../../astra-plugin-sdk-ts && bun install && bun run build && bun pm pack --destination /tmp/tgz)
#   node -e 'const f=require("fs"),p=JSON.parse(f.readFileSync("package.json","utf8"));
#            p.overrides={"astra-plugin-sdk":"file:/tmp/tgz/astra-plugin-sdk-0.5.0.tgz"};
#            f.writeFileSync("package.json",JSON.stringify(p,null,2))'
bun install                   # or npm install
bun run test                  # the reference suite, both levels
bun run build                 # esbuild bundles src/index.ts to dist/index.js
astra-plugin build            # produces json-tools-<version>-noarch.astraplugin

The bundle is noarch: one file that runs on every platform Astra supports, because the platform-specific part is the Node install, not the plugin.

How it is written

The object form, with the SDK's s schema builder:

json_format: tool({
  description: "Pretty-print JSON with configurable indentation.",
  input: s.object({
    json: s.string({ description: "JSON string to format" }),
    indent: s.integer({ minimum: 0, maximum: 10 }).optional(),
  }),
  run: ({ json, indent }, ctx) =>
    JSON.stringify(parse(json), null, indent ?? defaultIndent(ctx.config)),
});

input is the JSON Schema the assistant reads and the type of run's first argument. There is no String(args.json ?? "") anywhere in this plugin: the SDK validated the assistant's arguments against that schema before the handler ran, and a violation came back to the assistant as a BAD_ARGUMENTS result it can read and correct.

The test suite

test/plugin.test.mjs is meant to be copied. It runs at both of the SDK's levels:

  • Level 1 — Harness.create(app), in process, no socket. Every tool, the action, the config handling, assertSchemaAccepts / assertSchemaRejects, a RecordingHost with setVariable made to fail on purpose (so a step that could not publish its variable does not report success), and h.fuzzConfig(), which pushes eleven shapes of real-world config through onConfigChanged.
  • Level 2 — MockDaemon, a real gRPC handshake with a real session token, asserting the capabilities this plugin registers with are the ones plugin.toml declares and that a tool answers correctly over the wire.

Files

  • src/plugin.ts — the plugin, as a value. Read it alongside ../text-utils and ../dice-roller to see the same three capabilities in three languages.
  • src/index.ts — the two-line entrypoint.
  • test/plugin.test.mjs — the reference suite.
  • icon.svg — the store icon, hand-drawn SVG.

MIT licensed.

Releases

0.1.22026-08-19

Protocol 1

Permissions

  • set_variable StandardThe author says: “Publishes the transformed JSON as the variable your command names in 'Store Result In'”
Files and provenance
TargetSizeSHA-256
noarchjson-tools-0.1.2-noarch.astraplugin208.3 kB9772f9ca85c41e00c17637eb943882a41e616572d350dd0094589756fcd2f23c

Provenance

Repository
mihailinl/AstraPlugins
Release repository
mihailinl/AstraPlugins
Tag
json-tools-v0.1.2
Commit
9e6bf28ddda656cb6015a1076284d51db119f4e4
Older releases (1)

0.1.12026-08-10

Protocol 1

No SHA-256 — this release cannot be installed.

Files and provenance
TargetSizeSHA-256
noarchjson-tools-0.1.1-noarch.astrapluginNo SHA-256 — this release cannot be installed.

Provenance

Repository
mihailinl/AstraPlugins
Release repository
mihailinl/AstraPlugins
Tag
json-tools-v0.1.1
For the publisherThis listing has to be bound to a repositoryBind by 2026-12-15 06:00 UTC · cutover 2026-10-16 06:00 UTCHow

Migration notice, round 2.

The binding deadline is 2026-12-15 06:00 UTC.

Binding needs a Minice account that owns Astra, a binding line committed to the repository, a new tag, and a moderator’s approval of the first binding.

A release that is not held and passes the automated checks is published at once, marked not reviewed by moderators.

From 2026-10-16 06:00 UTC, a held release waits until this listing is bound.

Binding happens in the plugins panel; there is nowhere else to do it. Repository bindings