@tpmjs/tools-jq
Run a jq expression on JSON input. Supports filtering, mapping, and transforming JSON data.
jq error: jq: error: test/0 is not defined at <top-level>, line 1: test jq: 1 compile error
Last checked: 2/26/2026, 4:24:25 AM
Test @tpmjs/tools-jq (query) 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 { query } from '@tpmjs/tools-jq';import { generateText } from 'ai';
import { openai } from '@ai-sdk/openai';
import { query } from '@tpmjs/tools-jq';
const result = await generateText({
model: openai('gpt-4o'),
tools: { query },
prompt: 'Your prompt here...',
});
console.log(result.text);(json: string, filter: string, sortKeys?: boolean, nullInput?: boolean, rawOutput?: boolean) => Promise<unknown>Available configuration options
jsonstringJSON string to process.
filterstringjq filter expression (e.g., ".foo", ".[] | select(.x > 1)").
rawOutputbooleanOutput raw strings without JSON quotes (-r flag). Default false.
sortKeysbooleanSort object keys (-S flag). Default false.
nullInputbooleanUse null as input instead of the json field (-n flag). Default false.
Schema extracted: 2/26/2026, 4:24:25 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