redis_info
Retrieve connection information for the Redis server, including host, port, and status details, to verify and monitor database connectivity.
Instructions
获取连接信息。
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "redis_info"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:171-177 (registration)Tool registration in ListToolsRequestSchema handler; defines the tool name, description, and empty inputSchema for redis_info.
{ name: "redis_info", description: "获取连接信息。", inputSchema: { type: "object", properties: {} } }, { name: "redis_hset", description: "设置哈希字段。", inputSchema: { type: "object", properties: { key: { type: "string" }, field: { type: "string" }, value: { type: "string" } }, required: ["key", "field", "value"] } }, { name: "redis_hget", description: "获取哈希字段。", inputSchema: { type: "object", properties: { key: { type: "string" }, field: { type: "string" } }, required: ["key", "field"] } }, { name: "redis_hgetall", description: "获取哈希所有字段。", inputSchema: { type: "object", properties: { key: { type: "string" } }, required: ["key"] } }, { name: "redis_hdel", description: "删除哈希字段。", inputSchema: { type: "object", properties: { key: { type: "string" }, fields: { type: "array", items: { type: "string" } } }, required: ["key", "fields"] } } ] })); - src/index.ts:186-186 (handler)Handler implementation: returns a formatted string with project directory and number of cached Redis connections.
redis_info: async () => `Redis MCP 信息\n项目目录: ${projectDir}\n连接数: ${clientCache.size}`,