Skip to main content
Glama
redis

Redis MCP Server

Official
by redis

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

Implementation Reference

  • 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)}"
  • The @mcp.tool() decorator registers the get_index_info function as an MCP tool.
    @mcp.tool()

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