get_index_info
Retrieve schema and details for a specific Redis index using FT.INFO. Input the index name to fetch structured information or error messages for efficient Redis data management.
Instructions
Retrieve schema and information about a specific Redis index using FT.INFO.
Args: index_name (str): The name of the index to retrieve information about.
Returns: str: Information about the specified index or an error message.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| index_name | Yes |
Implementation Reference
- src/tools/redis_query_engine.py:28-44 (handler)The main handler function for the 'get_index_info' MCP tool. It is decorated with @mcp.tool(), which handles registration. The function retrieves detailed information about a specified Redis search index using FT.INFO and returns it as a formatted JSON string, or an error message if unsuccessful.@mcp.tool() async def get_index_info(index_name: str) -> str: """Retrieve schema and information about a specific Redis index using FT.INFO. Args: index_name (str): The name of the index to retrieve information about. Returns: str: Information about the specified index or an error message. """ try: r = RedisConnectionManager.get_connection() info = r.ft(index_name).info() return json.dumps(info, ensure_ascii=False, indent=2) except RedisError as e: return f"Error retrieving index info: {str(e)}"
- src/tools/redis_query_engine.py:28-28 (registration)The @mcp.tool() decorator registers the get_index_info function as an MCP tool.@mcp.tool()