We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a19ad2e commit 8264daeCopy full SHA for 8264dae
index.ts
@@ -112,10 +112,19 @@ export async function createElasticsearchMcpServer(
112
server.tool(
113
"list_indices",
114
"List all available Elasticsearch indices",
115
- {},
116
- async () => {
+ {
+ indexPattern: z
117
+ .string()
118
+ .trim()
119
+ .min(1, "Index pattern is required")
120
+ .describe("Index pattern of Elasticsearch indices to list"),
121
+ },
122
+ async ( {indexPattern} ) => {
123
try {
- const response = await esClient.cat.indices({ format: "json" });
124
+ const response = await esClient.cat.indices({
125
+ index: indexPattern,
126
+ format: "json"
127
+ });
128
129
const indicesInfo = response.map((index) => ({
130
index: index.index,
0 commit comments