list_indexes
Retrieve all available Splunk indexes to identify data sources for searching and analysis in Splunk Enterprise/Cloud environments.
Instructions
Get a list of all available Splunk indexes.
Returns:
Dictionary containing list of indexes
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- splunk_mcp.py:379-394 (handler)The handler function for the 'list_indexes' MCP tool. It connects to Splunk using get_splunk_connection(), retrieves all indexes, and returns them in a dictionary. Registered via the @mcp.tool() decorator.@mcp.tool() async def list_indexes() -> Dict[str, List[str]]: """ Get a list of all available Splunk indexes. Returns: Dictionary containing list of indexes """ try: service = get_splunk_connection() indexes = [index.name for index in service.indexes] logger.info(f"📊 Found {len(indexes)} indexes") return {"indexes": indexes} except Exception as e: logger.error(f"❌ Failed to list indexes: {str(e)}") raise