Skip to main content

Grafana

Connects to a Grafana instance's HTTP API. An agent can search dashboards, list alerts and data sources, link to panels, and create annotations.

Add to an agent node's tools array with _node_type: "tool-grafana". See Connector Reference — How connectors are used.

Authentication

FieldRequiredDescription
base_urlYesBase URL of the Grafana instance (e.g. https://grafana.example.com).
api_keyNoGrafana service account token, sent as Authorization: Bearer <api_key>.
{
"name": "grafana",
"_node_type": "tool-grafana",
"base_url": "https://grafana.example.com",
"api_key": "{{ secret.GRAFANA_API_KEY }}"
}

Tools

grafana_list_dashboards

List Grafana dashboards with their UIDs and folder.

Parameters

ParameterTypeRequiredDescription
querystringNoSearch query for dashboard titles

Returns: A newline-separated list of uid=<uid> <title> lines.

grafana_query_panel

Get a direct link to a Grafana dashboard panel with a time range.

Parameters

ParameterTypeRequiredDescription
dashboard_uidstringYesDashboard UID
panel_idnumberYesPanel ID
fromstringNoStart time e.g. now-1h (default now-1h)
tostringNoEnd time e.g. now (default now)

Returns: A single line: Panel link: <base_url>/d/<dashboard_uid>?panelId=<panel_id>&from=<from>&to=<to>. (Constructed locally; does not call the Grafana API.)

grafana_list_alerts

List Grafana alerts and their current state.

Parameters

ParameterTypeRequiredDescription
statestringNoFilter by state: alerting, ok, no_data, pending (empty = all)

Returns: A newline-separated list of [<state>] <name> lines, or "No alerts found.". Falls back to the unified alerting /api/v1/provisioning/alert-rules endpoint if the legacy /api/alerts endpoint fails.

grafana_create_annotation

Create a Grafana annotation (vertical marker on dashboards) to mark deployments or incidents.

Parameters

ParameterTypeRequiredDescription
textstringYesAnnotation text
tagsstringNoComma-separated tags
timenumberNoUnix timestamp in milliseconds (0 = now)

Returns: A confirmation message: Annotation created (id=<id>): <text>.

grafana_list_datasources

List all Grafana data sources configured in the instance.

No parameters.

Returns: A newline-separated list of [<id>] <name> type=<type> lines.

Next