dhis2_query
Query a DHIS2 instance via its API for metadata validation, data element lookup, indicator queries, and data quality checks. Returns formatted JSON responses.
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"})
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": {
"endpoint": "<endpoint>"
},
"name": "dhis2_query"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| endpoint | Yes | ||
| params | No | ||
| method | No | GET | |
| body | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |