Grafana
Interact with a Grafana instance via its HTTP API. Search dashboards, retrieve dashboard details, list data sources, and list provisioned alert rules.
Operations
| Operation | Description | Key Inputs |
|---|---|---|
search-dashboards |
Search dashboards by title (returns up to 100 results) | query (optional title filter) |
get-dashboard |
Retrieve full dashboard JSON by UID | dashboardUid (required) |
list-datasources |
List all configured data sources | — |
list-alert-rules |
List all provisioned alert rules (Grafana 9+) | — |
API Key Setup
- In Grafana, go to Administration > Users and access > Service Accounts.
- Create a service account with the Viewer role (or Editor if you need write access in future).
- Click Add service account token and copy the generated token.
- Pass the token as
apiKeyin the tool input.
Authentication uses Authorization: Bearer <token> as documented at https://grafana.com/docs/grafana/latest/developers/http_api/auth/.
Examples
Search for dashboards containing "nginx":
{
"apiKey": "glsa_xxxx",
"grafanaUrl": "http://grafana.example.com:3000",
"operation": "search-dashboards",
"query": "nginx"
}
Get a specific dashboard:
{
"apiKey": "glsa_xxxx",
"grafanaUrl": "http://grafana.example.com:3000",
"operation": "get-dashboard",
"dashboardUid": "abc123def"
}
List all data sources:
{
"apiKey": "glsa_xxxx",
"grafanaUrl": "http://grafana.example.com:3000",
"operation": "list-datasources"
}
List alert rules:
{
"apiKey": "glsa_xxxx",
"grafanaUrl": "http://grafana.example.com:3000",
"operation": "list-alert-rules"
}
Notes
grafanaUrlmust include the scheme and port (e.g.http://localhost:3000) with no trailing slash.- The
list-alert-rulesoperation requires Grafana 9+ and the Alerting feature enabled. - Responses are returned as a JSON string in the
resultpublish variable. - Body reads are capped at 5 MB.