Skip to main content
Glama

key_search

Search Redis database keys using pattern matching with wildcards (*, ?, []). Streamline key discovery for efficient data management and retrieval.

Instructions

查找匹配的键

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
patternYes匹配模式(支持通配符 * ? [])

Implementation Reference

  • The handler function for 'key_search' tool. Ensures Redis connection, calls redisService.keys(pattern), formats result as JSON text response.
    private async handleKeySearch(args: any) { this.ensureRedisConnection(); const result = await this.redisService!.keys(args.pattern); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2) } ] }; }
  • Registration of the 'key_search' tool in the MCP tools list, including name, description, and input schema definition.
    { name: 'key_search', description: '查找匹配的键', inputSchema: { type: 'object', properties: { pattern: { type: 'string', description: '匹配模式(支持通配符 * ? [])' } }, required: ['pattern'] } },
  • Switch case in request handler that dispatches 'key_search' tool calls to the handleKeySearch method.
    case 'key_search': return await this.handleKeySearch(args);

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/pickstar-2002/redis-mcp'

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