list_datasources
Retrieve available Grafana datasources to identify data connections for monitoring and visualization. Optionally filter by specific types like Prometheus or Loki to find relevant data sources.
Instructions
List available Grafana datasources. Optionally filter by datasource type.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | No | The type of datasources to search for (e.g., "prometheus", "loki") |
Implementation Reference
- src/clients/grafana-client.ts:88-101 (helper)GrafanaClient.listDatasources method: fetches all datasources from Grafana /api/datasources endpoint and optionally filters by type.
async listDatasources(type?: string): Promise<Datasource[]> { try { const response = await this.client.get('/api/datasources'); let datasources = response.data; if (type) { datasources = datasources.filter((ds: Datasource) => ds.type === type); } return datasources; } catch (error) { this.handleError(error); } }