Skip to main content
Glama
redis

Redis MCP Server

Official
by redis

get_indexes

Retrieve a JSON-formatted list of indexes from a Redis database using this tool. Designed for the Redis MCP Server, it enables efficient data management and querying by providing essential index information.

Instructions

List of indexes in the Redis database

Returns: str: A JSON string containing the list of indexes or an error message.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'get_indexes' tool, decorated with @mcp.tool() for registration. It connects to Redis and returns a JSON list of indexes or an error message.
    @mcp.tool() async def get_indexes() -> str: """List of indexes in the Redis database Returns: str: A JSON string containing the list of indexes or an error message. """ try: r = RedisConnectionManager.get_connection() return json.dumps(r.execute_command("FT._LIST")) except RedisError as e: return f"Error retrieving indexes: {str(e)}"
  • The @mcp.tool() decorator registers the get_indexes 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