list_data_views
Retrieve all available data views (index patterns) from Kibana to access and analyze Elasticsearch data sources.
Instructions
List all data views (index patterns) in Kibana
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/index.ts:282-304 (handler)The handler for the 'list_data_views' tool, which calls the kibanaClient and formats the output.
case 'list_data_views': { const dataViews = await kibanaClient.listDataViews(); return { content: [ { type: 'text' as const, text: JSON.stringify( { total: dataViews.total, dataViews: dataViews.saved_objects.map((dv) => ({ id: dv.id, title: dv.attributes.title, timeFieldName: dv.attributes.timeFieldName, })), }, null, 2 ), }, ], }; } - src/tools/index.ts:119-125 (registration)Tool registration for 'list_data_views' in the MCP server setup.
name: 'list_data_views', description: 'List all data views (index patterns) in Kibana', inputSchema: { type: 'object', properties: {}, }, }, - src/kibana/client.ts:171-180 (helper)The KibanaClient implementation that performs the actual API request to list index patterns (data views).
async listDataViews(): Promise<SavedObjectsResponse<KibanaDataView>> { const response = await this.axiosInstance.get('/api/saved_objects/_find', { params: { type: 'index-pattern', per_page: 100, }, }); return response.data; }