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.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "list_datasources"
}
}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); } }