Skip to main content
Glama
redis

Redis MCP Server

Official
by redis

get_index_info

Retrieve schema and configuration details for a specific Redis index using FT.INFO command to understand its structure and properties.

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
NameRequiredDescriptionDefault
index_nameYes

Implementation Reference

  • The main handler function for the 'get_index_info' tool, decorated with @mcp.tool() for registration. It retrieves detailed information about a Redis search index using FT.INFO and returns it as a formatted JSON string, handling Redis errors gracefully.
    @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)}"

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/redis/mcp-redis'

If you have feedback or need assistance with the MCP directory API, please join our Discord server