Skip to content

MCP Prompts: Redis skill library for search index workflows #839

@joshrotenberg

Description

@joshrotenberg

Parent: #833

Summary

Implement MCP prompts (the protocol-native skill/workflow feature) to ship curated, high-level Redis workflows alongside the tool primitives. Prompts are server-defined templates that AI clients can discover via prompts/list and invoke via prompts/get, providing structured guidance for complex multi-step operations.

Why Prompts

The database tools (#835, #837) give the AI raw capabilities (FT.CREATE, FT.SEARCH, FT.PROFILE, etc.), but the real value comes from knowing how to combine them effectively. Prompts encode Redis expertise into reusable workflows that any AI client can leverage -- they're the difference between "here are 20 search commands" and "let me optimize your search index."

Proposed Prompts

Search Index Workflows

Prompt Parameters Description
optimize-index key_pattern, query_examples, optimization_goal Analyze data shape, propose index schemas, create test indexes, run queries, compare performance, recommend best option
profile-query index_name, query Explain query plan (FT.EXPLAIN), profile execution (FT.PROFILE), identify bottlenecks, suggest improvements
design-index key_pattern, use_cases Sample data, infer field types/cardinality, recommend schema with rationale for each field type choice
migrate-index index_name, changes Plan and execute zero-downtime index schema migration (create new index, verify, swap alias, drop old)
audit-index index_name Check index health: size vs data ratio, unused fields, missing SORTABLE on sorted fields, suboptimal field types

General Database Workflows

Prompt Parameters Description
explore-data key_pattern Profile keys matching pattern: types, sizes, TTLs, encodings, sample values
memory-audit (none) Analyze memory usage: hotkeys, type distribution, big keys, fragmentation, eviction policy review
health-report (none) Comprehensive health report: connectivity, performance metrics, slow queries, client connections, memory

Implementation Notes

  • tower-mcp supports prompts via McpRouter -- need to verify current API
  • Prompts return structured messages (system + user) that guide the AI through the workflow
  • Each prompt should reference the specific tools it will use, so the AI knows what's available
  • Prompts can include conditional logic (e.g., skip FT.PROFILE if RediSearch not loaded)
  • Consider a prompts/ module in redisctl-mcp parallel to tools/

Prerequisites

Relationship to #838

#838 describes the search optimization workflows at a high level. This issue is about implementing them as MCP prompts specifically, which is the protocol-native way to deliver them. The prompts here subsume the workflows described in #838.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions