fm_analyze
Analyze FileMaker datasets with groupby, aggregation, filtering, pivoting, and time-series resampling. Returns compact summary tables instead of raw records.
Instructions
Analyze a loaded dataset with groupby/aggregation. No FM round trip.
Runs pandas aggregation on a previously loaded dataset OR a table from the auto-populated table cache (from query_records). Returns compact summary tables instead of raw records — ~200 tokens vs ~400K tokens.
Behavior by parameter combination:
groupby + aggregate: Grouped aggregation (most common)
aggregate only: Scalar aggregation across all rows
groupby only: Group counts (value_counts)
neither: Summary statistics (describe)
period: Time-series resampling (week/month/quarter)
pivot_column: Cross-tabulation pivot table
Supported aggregate functions: sum, count, mean, min, max, median, nunique, std
Args: dataset: Name of a previously loaded dataset (from fm_load_dataset), or a table name from the auto-populated table cache. groupby: Comma-separated field names to group by. Example: "Technician,Region" aggregate: Comma-separated function:field pairs. Example: "sum:Amount,count:Amount,mean:Amount" filter: Pandas query expression to narrow data before aggregating. Example: "Region == 'A'" or "Amount > 500" sort: Sort result by column name with optional direction. Example: "Amount_sum desc" limit: Maximum rows in output (default 50). period: Time-series resampling — "week", "month", or "quarter". First groupby field must be a datetime column. Example: groupby="ServiceDate", period="month" pivot_column: Cross-tabulate by this column (pivot table). Requires groupby for row index and aggregate for values. Example: groupby="Technician", pivot_column="Region", aggregate="sum:Amount"
Returns: Formatted summary table with aggregation results.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sort | No | ||
| limit | No | ||
| filter | No | ||
| period | No | ||
| dataset | Yes | ||
| groupby | No | ||
| aggregate | No | ||
| pivot_column | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |