Descriptive Statistics of KoboToolbox Data
kobo_analyzeCompute descriptive statistics for survey questions in a form, returning counts, percentages, means, medians, and date ranges. Filter to selected columns or use a query to analyze response subsets.
Instructions
Compute descriptive statistics for every question (or a chosen subset) of a form.
For each question it returns the statistics that fit its type:
categorical: counts and percentages per answer option (multi-select handled correctly — percentages are of respondents, so they can exceed 100%)
numeric: n, mean, median, standard deviation, min, max, quartiles, sum
date: earliest and latest
free text: number of distinct answers plus examples
Args:
uid (string): the form's asset uid
columns (array, optional): restrict to these questions (field name or question label)
query (string, optional): Mongo-style filter
response_format ('markdown' | 'json')
Loads the data automatically if it isn't cached yet.
Examples:
Use when: "What do the responses to my cocoa form look like?" -> uid=...
Use when: "What's the average plot size?" -> columns=["plot_size"]
Don't use when: you need two questions crossed (use kobo_crosstab)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| uid | Yes | Asset uid of the form (from kobo_list_forms) | |
| query | No | Optional Mongo-style filter applied server-side, e.g. '{"region":"Sud-Ouest"}' or '{"_submission_time":{"$gte":"2026-01-01"}}' | |
| columns | No | Restrict the profile to these questions (field name or question label). Omit for all. | |
| response_format | No | Output format: 'markdown' for human-readable or 'json' for machine-readable | markdown |