@tpmjs/tools-jq
Pretty-print JSON with consistent formatting.
Test @tpmjs/tools-jq (format) with AI-powered execution
0/2000 characters
Install this tool and use it with the AI SDK
npm install @tpmjs/tools-jqpnpm add @tpmjs/tools-jqyarn add @tpmjs/tools-jqbun add @tpmjs/tools-jqdeno add npm:@tpmjs/tools-jqimport { format } from '@tpmjs/tools-jq';import { generateText } from 'ai';
import { openai } from '@ai-sdk/openai';
import { format } from '@tpmjs/tools-jq';
const result = await generateText({
model: openai('gpt-4o'),
tools: { format },
prompt: 'Your prompt here...',
});
console.log(result.text);(json: string, compact?: boolean, sortKeys?: boolean) => Promise<unknown>Available configuration options
jsonstringJSON string to format.
sortKeysbooleanSort object keys alphabetically. Default false.
compactbooleanCompact output (no whitespace). Default false.
Schema extracted: 3/1/2026, 4:28:55 AM
jq JSON processing tools for AI agents. Query, filter, and format JSON data using jq expressions.
The jq binary must be available in the system PATH. The TPMJS executor Docker image includes it.
import { query, format } from '@tpmjs/tools-jq';
Downloads/month
91
GitHub Stars
15
Quality Score