dhis2_query
Query a DHIS2 instance via authenticated API calls to retrieve metadata, validate data elements, check indicators, and perform data quality checks.
Instructions
Make an authenticated API call to the configured DHIS2 instance.
Returns the JSON response as formatted text. Use for live metadata
validation, data element lookup, indicator queries, and data quality checks.
Args:
endpoint: API path relative to /api/, e.g. "dataElements" or "organisationUnits.json".
If it does not start with "/api/", that prefix is added automatically.
params: Query parameters as a dict, e.g. {"fields": "id,name", "paging": "false"}.
method: HTTP method — "GET" (default), "POST", or "PUT".
body: Request body for POST/PUT (serialised to JSON).
Examples:
dhis2_query("dataElements", {"fields": "id,name,valueType", "paging": "false"})
dhis2_query("system/info")
dhis2_query("organisationUnits", {"filter": "level:eq:2", "fields": "id,name,level"})Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| endpoint | Yes | ||
| params | No | ||
| method | No | GET | |
| body | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |