Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,19 @@ export async function createElasticsearchMcpServer(
server.tool(
"list_indices",
"List all available Elasticsearch indices",
{},
async () => {
{
indexPattern: z
.string()
.trim()
.min(1, "Index pattern is required")
.describe("Index pattern of Elasticsearch indices to list"),
},
async ( {indexPattern} ) => {
try {
const response = await esClient.cat.indices({ format: "json" });
const response = await esClient.cat.indices({
index: indexPattern,
format: "json"
});

const indicesInfo = response.map((index) => ({
index: index.index,
Expand Down