profile
Summarizes selected JSON fields across records in one server-side scan, replacing ad-hoc loops for field discovery. Returns presence, null, type, distinct, numeric, length, and top-value summaries.
Instructions
Profile one or more fields across every selected record in one server-side scan; this replaces ad-hoc Python loops for discovering or summarizing unfamiliar JSON fields. Pass filePath for a one-call answer, or docId to reuse an open document. Returns present/missing/null counts, type counts, distinct count, exact numeric sum/min/max/average, lengths, and top values. Use fields like "status" or "capacity.used" relative to each selected record; omit fields to auto-discover up to 20 fields on selected records or profile selected scalar values. For a filtered count or a group breakdown use run_query; for whole records use sample.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| top | No | Top values per field (default 10, max 50). | |
| docId | No | A docId returned by load_doc. | |
| query | Yes | Path/predicate selecting records, e.g. $.tasks[*]. Do not append a pipe. | |
| fields | No | Optional relative fields to profile together, e.g. ["status", "failureReason", "weightKg"]. | |
| filePath | No | File to open and profile now instead of supplying docId. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| hint | No | ||
| tool | Yes | ||
| error | No | ||
| evicted | No | ||
| structuredTruncated | No |