get_index_info
Retrieve detailed metadata for a specific Splunk index by providing the index name. Ideal for managing and analyzing Splunk data resources effectively.
Instructions
Get metadata for a specific Splunk index.
Args:
index_name: Name of the index to get metadata for
Returns:
Dictionary containing index metadata
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| index_name | Yes |
Implementation Reference
- splunk_mcp.py:396-424 (handler)The handler function for the 'get_index_info' MCP tool, decorated with @mcp.tool() for automatic registration and schema inference from type hints and docstring. It connects to Splunk, retrieves the specified index, and returns key metadata such as event count, sizes, and time range.@mcp.tool() async def get_index_info(index_name: str) -> Dict[str, Any]: """ Get metadata for a specific Splunk index. Args: index_name: Name of the index to get metadata for Returns: Dictionary containing index metadata """ try: service = get_splunk_connection() index = service.indexes[index_name] return { "name": index_name, "total_event_count": str(index["totalEventCount"]), "current_size": str(index["currentDBSizeMB"]), "max_size": str(index["maxTotalDataSizeMB"]), "min_time": str(index["minTime"]), "max_time": str(index["maxTime"]) } except KeyError: logger.error(f"❌ Index not found: {index_name}") raise ValueError(f"Index not found: {index_name}") except Exception as e: logger.error(f"❌ Failed to get index info: {str(e)}") raise