Summarize the trial catalogue
aggregate_trialsGroup-by count of trials across one or two axes. Single axis: set groupByPrimary to 'compound' | 'topic' | 'country' | 'phase' | 'status' | 'year' | 'sponsor' | 'researcher'. Two axes: also set groupBySecondary (e.g. groupByPrimary='compound', groupBySecondary='topic') for a 2D matrix — perfect for 'what conditions is each psychedelic studied for'. Returns ranked buckets with sample citations. 1D buckets: {key, label, count, sample}. 2D buckets: {rowKey, rowLabel, colKey, colLabel, count, sample}. Same filter shape as search_trials; filters are optional.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"filters": "<filters>",
"groupByPrimary": "<groupByPrimary>"
},
"name": "aggregate_trials"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filters | Yes | Same supported filter shape as search_trials, except registrationNumbers, trialState/trialStates, and deviceFamily. Filters are OPTIONAL for aggregates — pass `{}` to group across all trials. `limit` is ignored. | |
| groupByPrimary | Yes | Primary axis to group by ("compound" | "topic" | "country" | "phase" | "status" | "year" | "sponsor" | "researcher"). Required. | |
| groupBySecondary | No | Optional second axis for a 2D matrix. Set this for "compounds × topics" or "phase × country"-style breakdowns. Result has rowKey/colKey/count cells. 2D output caps at 50 buckets after sort. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |