1.5.0npm · @betterdb/mcp · current release
Observed 2026-08-31T15:57:36.882Z using mcpSecurity-inventory. Status: succeeded. Negotiated protocol: 2025-06-18.
{
"tools": {
"listChanged": true
}
}| Tool | Category | Annotations | Risk |
|---|---|---|---|
add_connectionAdd a new Valkey/Redis connection to BetterDB. Optionally set it as the active default.Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Display name for the connection"
},
"host": {
"type": "string",
"description": "Hostname or IP address"
},
"port": {
"default": 6379,
"description": "Port number",
"type": "integer",
"minimum": 1,
"maximum": 65535
},
"username": {
"description": "ACL username (default: \"default\")",
"type": "string"
},
"password": {
"description": "Auth password",
"type": "string"
},
"setAsDefault": {
"description": "Set this connection as the active default",
"type": "boolean"
}
},
"required": [
"name",
"host"
]
} | — | — · — | — |
ai_instance_historyGet the stored metrics time-series for one AI component instance (hits, misses, hit rate, cost saved, evictions, item count, index size, threshold). Use ai_list_instances first to find the instance field identifier. Use this to see trends: hit-rate degradation, growth, threshold drift.Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "Instance field identifier from ai_list_instances"
},
"hours": {
"description": "Look-back window in whole hours, 1-168 (default 24)",
"type": "integer",
"minimum": 1,
"maximum": 168
},
"instanceId": {
"description": "Optional instance ID override",
"type": "string"
}
},
"required": [
"field"
]
} | — | — · — | — |
ai_list_instancesList AI component instances (semantic caches, agent caches, agent memory stores, retrieval pipelines) auto-discovered on the connected Valkey/Redis instance, with liveness and the latest stored metrics sample. This is the superset discovery view across all AI components — use cache_list for cache-specific live stats and memory_stores for memory-store details. Use the returned instance field value as the field parameter of ai_instance_history.Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"instanceId": {
"description": "Optional instance ID override",
"type": "string"
}
}
} | — | — · — | — |
cache_approve_proposalApprove a pending proposal. Synchronously applies the change to Valkey and returns the terminal status (applied|failed). Idempotent: a second call on an already-applied proposal returns the cached result.Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"proposal_id": {
"type": "string",
"minLength": 1,
"description": "Proposal id"
},
"actor": {
"description": "Optional actor identity stamped into the audit trail",
"type": "string",
"minLength": 1
}
},
"required": [
"proposal_id"
]
} | — | — · — | — |
cache_edit_and_approve_proposalEdit an existing pending proposal and approve it in one step. Provide exactly one edit field matching the proposal type: new_threshold for threshold_adjust, new_ttl_seconds for tool_ttl_adjust. Invalidate proposals are not editable.Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"proposal_id": {
"type": "string",
"minLength": 1,
"description": "Proposal id"
},
"new_threshold": {
"description": "For threshold_adjust proposals",
"type": "number",
"minimum": 0,
"maximum": 2
},
"new_ttl_seconds": {
"description": "For tool_ttl_adjust proposals",
"type": "integer",
"minimum": 10,
"maximum": 86400
},
"actor": {
"description": "Optional actor identity stamped into the audit trail",
"type": "string",
"minLength": 1
}
},
"required": [
"proposal_id"
]
} | — | — · — | — |
cache_get_proposalFetch a single cache proposal by id, including its audit trail.Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"proposal_id": {
"type": "string",
"minLength": 1,
"description": "Proposal id (returned by cache_propose_*)"
}
},
"required": [
"proposal_id"
]
} | — | — · — | — |
cache_healthDetailed health for a single cache. Response branches by type: semantic_cache reports category_breakdown + uncertain_hit_rate; agent_cache reports tool_breakdown.Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"cache_name": {
"type": "string",
"minLength": 1,
"description": "Cache name as registered in __betterdb:caches (e.g. 'betterdb_scache_prod')."
},
"instanceId": {
"description": "Connection ID; defaults to the active instance",
"type": "string",
"pattern": "^[a-zA-Z0-9_-]+$"
}
},
"required": [
"cache_name"
]
} | — | — · — | — |
cache_listList all caches (semantic_cache and agent_cache) registered for the active instance, with hit rate and total ops.Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"instanceId": {
"description": "Connection ID; defaults to the active instance",
"type": "string",
"pattern": "^[a-zA-Z0-9_-]+$"
}
}
} | — | — · — | — |
cache_list_pending_proposalsList pending cache proposals for the active instance, newest first. Optionally filter by cache_name.Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"cache_name": {
"description": "Restrict to a single cache",
"type": "string",
"minLength": 1
},
"limit": {
"description": "Max proposals to return (default 100, max 200)",
"type": "integer",
"minimum": 1,
"maximum": 200
},
"instanceId": {
"description": "Connection ID; defaults to the active instance",
"type": "string",
"pattern": "^[a-zA-Z0-9_-]+$"
}
}
} | — | — · — | — |
cache_propose_invalidatePropose a cache invalidation for review. Filter shape depends on cache type: semantic_cache requires filter_kind=valkey_search + filter_expression; agent_cache requires filter_kind in (tool|key_prefix|session) + filter_value. Warns when estimated_affected exceeds 10000.Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"cache_name": {
"type": "string",
"minLength": 1,
"description": "Name of the cache to invalidate"
},
"filter_kind": {
"type": "string",
"enum": [
"valkey_search",
"tool",
"key_prefix",
"session"
],
"description": "Discriminator: valkey_search for semantic_cache; tool|key_prefix|session for agent_cache"
},
"filter_expression": {
"description": "Required when filter_kind=valkey_search; FT.SEARCH filter",
"type": "string",
"minLength": 1
},
"filter_value": {
"description": "Required when filter_kind in (tool|key_prefix|session); the matching value",
"type": "string",
"minLength": 1
},
"estimated_affected": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991,
"description": "Caller-estimated number of affected entries"
},
"reasoning": {
"type": "string",
"minLength": 20,
"description": "Why the invalidation is being proposed (≥20 chars)"
},
"instanceId": {
"description": "Connection ID; defaults to the active instance",
"type": "string",
"pattern": "^[a-zA-Z0-9_-]+$"
}
},
"required": [
"cache_name",
"filter_kind",
"estimated_affected",
"reasoning"
]
} | — | — · — | — |
cache_propose_threshold_adjustPropose a semantic-cache similarity-threshold change for review. Creates a pending proposal that requires human approval before any change is applied. Reasoning must be at least 20 characters.Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"cache_name": {
"type": "string",
"minLength": 1,
"description": "Name of the semantic cache (e.g. 'betterdb_scache_prod')"
},
"new_threshold": {
"type": "number",
"minimum": 0,
"maximum": 2,
"description": "Proposed cosine-distance threshold, 0–2"
},
"category": {
"description": "Optional per-category override; null/undefined = global threshold",
"type": [
"string",
"null"
]
},
"reasoning": {
"type": "string",
"minLength": 20,
"description": "Why the change is being proposed (≥20 chars)"
},
"instanceId": {
"description": "Connection ID; defaults to the active instance",
"type": "string",
"pattern": "^[a-zA-Z0-9_-]+$"
}
},
"required": [
"cache_name",
"new_threshold",
"reasoning"
]
} | — | — · — | — |
cache_propose_tool_ttl_adjustPropose an agent-cache per-tool TTL change for review. Creates a pending proposal that requires human approval. Reasoning must be at least 20 characters.Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"cache_name": {
"type": "string",
"minLength": 1,
"description": "Name of the agent cache (e.g. 'betterdb_agentcache_prod')"
},
"tool_name": {
"type": "string",
"minLength": 1,
"description": "Tool whose TTL is being changed"
},
"new_ttl_seconds": {
"type": "integer",
"minimum": 10,
"maximum": 86400,
"description": "Proposed TTL in seconds (10–86400)"
},
"reasoning": {
"type": "string",
"minLength": 20,
"description": "Why the change is being proposed (≥20 chars)"
},
"instanceId": {
"description": "Connection ID; defaults to the active instance",
"type": "string",
"pattern": "^[a-zA-Z0-9_-]+$"
}
},
"required": [
"cache_name",
"tool_name",
"new_ttl_seconds",
"reasoning"
]
} | — | — · — | — |
cache_recent_changesRecent proposals for a single cache (any status), so agents can avoid re-proposing pending or recently-applied changes. Newest first.Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"cache_name": {
"type": "string",
"minLength": 1,
"description": "Cache name as registered in __betterdb:caches (e.g. 'betterdb_scache_prod')."
},
"limit": {
"description": "Max proposals to return (default 20, max 200)",
"type": "integer",
"minimum": 1,
"maximum": 200
},
"instanceId": {
"description": "Connection ID; defaults to the active instance",
"type": "string",
"pattern": "^[a-zA-Z0-9_-]+$"
}
},
"required": [
"cache_name"
]
} | — | — · — | — |
cache_reject_proposalReject a pending proposal. Optionally records a reason in the audit trail.Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"proposal_id": {
"type": "string",
"minLength": 1,
"description": "Proposal id"
},
"reason": {
"description": "Optional rejection reason recorded on the audit row",
"type": "string",
"minLength": 1
},
"actor": {
"description": "Optional actor identity stamped into the audit trail",
"type": "string",
"minLength": 1
}
},
"required": [
"proposal_id"
]
} | — | — · — | — |
cache_similarity_distributionHistogram of recent similarity scores (20 buckets, width 0.1) for a semantic_cache. Errors on agent_cache.Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"cache_name": {
"type": "string",
"minLength": 1,
"description": "Cache name as registered in __betterdb:caches (e.g. 'betterdb_scache_prod')."
},
"category": {
"description": "Restrict to a single category",
"type": "string"
},
"window_hours": {
"description": "Lookback window (default 24h, max 168h)",
"type": "integer",
"minimum": 1,
"maximum": 168
},
"instanceId": {
"description": "Connection ID; defaults to the active instance",
"type": "string",
"pattern": "^[a-zA-Z0-9_-]+$"
}
},
"required": [
"cache_name"
]
} | — | — · — | — |
cache_threshold_recommendationThreshold-tuning recommendation for a semantic_cache, based on the rolling similarity-score window. Errors with INVALID_CACHE_TYPE on agent_cache.Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"cache_name": {
"type": "string",
"minLength": 1,
"description": "Cache name as registered in __betterdb:caches (e.g. 'betterdb_scache_prod')."
},
"category": {
"description": "Restrict to a single category; omit for the global threshold",
"type": "string"
},
"minSamples": {
"description": "Minimum samples required (default 100)",
"type": "integer",
"minimum": 1,
"maximum": 9007199254740991
},
"instanceId": {
"description": "Connection ID; defaults to the active instance",
"type": "string",
"pattern": "^[a-zA-Z0-9_-]+$"
}
},
"required": [
"cache_name"
]
} | — | — · — | — |
cache_tool_effectivenessPer-tool hit rate, cost saved, and TTL recommendation for an agent_cache. Errors with INVALID_CACHE_TYPE on semantic_cache.Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"cache_name": {
"type": "string",
"minLength": 1,
"description": "Cache name as registered in __betterdb:caches (e.g. 'betterdb_scache_prod')."
},
"instanceId": {
"description": "Connection ID; defaults to the active instance",
"type": "string",
"pattern": "^[a-zA-Z0-9_-]+$"
}
},
"required": [
"cache_name"
]
} | — | — · — | — |
correlate_ai_traceExplain WHY a trace behaved the way it did by joining its cache/memory spans with live Valkey state: does the key still exist, what is its TTL, what threshold was active, what is the index state. The strongest tool for diagnosing unexpected cache misses or stale memory recalls. Requires a selected instance (the one the AI components run on).Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"traceId": {
"type": "string",
"description": "Trace ID from list_ai_traces"
},
"instanceId": {
"description": "Optional instance ID override",
"type": "string"
}
},
"required": [
"traceId"
]
} | — | — · — | — |
get_acl_auditGet persisted ACL audit log entries from storage. Filter by username, reason (auth, command, key, channel), or time range. Use this to investigate why a connection is failing or audit access patterns.Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"username": {
"description": "Filter by username",
"type": "string"
},
"reason": {
"description": "Filter by reason (auth, command, key, channel)",
"type": "string"
},
"startTime": {
"description": "Start time (Unix timestamp ms)",
"type": "number"
},
"endTime": {
"description": "End time (Unix timestamp ms)",
"type": "number"
},
"limit": {
"description": "Max entries to return",
"type": "number"
},
"instanceId": {
"description": "Optional instance ID override",
"type": "string"
}
}
} | — | — · — | — |
get_ai_traceGet the full span waterfall for one AI trace: every span with timing, parent relationships, and attributes (model, cache hit/miss, similarity scores). Use list_ai_traces to find trace IDs.Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"traceId": {
"type": "string",
"description": "Trace ID from list_ai_traces"
}
},
"required": [
"traceId"
]
} | — | — · — | — |
get_anomaliesGet anomaly detection events from persisted storage. BetterDB continuously runs Z-score analysis on memory, hit rate, CPU, and other metrics — this returns the detected anomalies. Use to investigate what triggered an alert or correlate with an incident.Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"limit": {
"description": "Max events to return",
"type": "number"
},
"metricType": {
"description": "Filter by metric type",
"type": "string"
},
"startTime": {
"description": "Start time (Unix timestamp ms)",
"type": "number"
},
"instanceId": {
"description": "Optional instance ID override",
"type": "string"
}
}
} | — | — · — | — |
get_client_activityGet time-bucketed client activity from persisted snapshots. Shows connection counts, command distribution, and buffer usage over time. Use startTime/endTime to focus on a specific incident window.Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"startTime": {
"description": "Start time (Unix timestamp ms)",
"type": "number"
},
"endTime": {
"description": "End time (Unix timestamp ms)",
"type": "number"
},
"bucketSizeMinutes": {
"description": "Bucket size in minutes (default 5)",
"type": "number"
},
"instanceId": {
"description": "Optional instance ID override",
"type": "string"
}
}
} | — | — · — | — |
get_clientsGet the active client list with connection details.Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"instanceId": {
"description": "Optional instance ID override",
"type": "string"
}
}
} | — | — · — | — |
get_cluster_node_statsGet per-node performance stats: memory usage, ops/sec, connected clients, replication offset, and CPU. Use this to identify hot nodes, lagging replicas, or uneven load distribution.Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"instanceId": {
"description": "Optional instance ID override",
"type": "string"
}
}
} | — | — · — | — |
get_cluster_nodesDiscover all nodes in the Valkey cluster — role (master/replica), address, health status, and slot ranges. Returns an error message if this instance is not running in cluster mode.Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"instanceId": {
"description": "Optional instance ID override",
"type": "string"
}
}
} | — | — · — | — |
get_cluster_slowlogGet the aggregated slowlog across ALL nodes in the cluster. This is the primary tool for finding slow commands in cluster mode — per-node slowlogs are incomplete. Returns an error message if not in cluster mode.Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"limit": {
"description": "Max entries to return (default 100)",
"type": "number"
},
"instanceId": {
"description": "Optional instance ID override",
"type": "string"
}
}
} | — | — · — | — |
get_commandlogGet the most recent entries from COMMANDLOG (Valkey 8+ only, superset of slowlog).Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"count": {
"description": "Number of entries to return (default 25)",
"type": "number"
},
"instanceId": {
"description": "Optional instance ID override",
"type": "string"
}
}
} | — | — · — | — |
get_commandlog_historyGet persisted COMMANDLOG entries from storage (Valkey 8+ only). Supports time range filtering to investigate specific incidents. Returns empty with a note if COMMANDLOG is not supported on this instance.Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"startTime": {
"description": "Start time (Unix timestamp ms)",
"type": "number"
},
"endTime": {
"description": "End time (Unix timestamp ms)",
"type": "number"
},
"command": {
"description": "Filter by command name",
"type": "string"
},
"minDuration": {
"description": "Min duration in microseconds",
"type": "number"
},
"limit": {
"description": "Max entries to return",
"type": "number"
},
"instanceId": {
"description": "Optional instance ID override",
"type": "string"
}
}
} | — | — · — | — |
get_commandlog_patternsGet analyzed COMMANDLOG patterns from persisted storage (Valkey 8+ only). Like get_slowlog_patterns but includes large-request and large-reply patterns in addition to slow commands.Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"startTime": {
"description": "Start time (Unix timestamp ms)",
"type": "number"
},
"endTime": {
"description": "End time (Unix timestamp ms)",
"type": "number"
},
"limit": {
"description": "Max entries to analyze",
"type": "number"
},
"instanceId": {
"description": "Optional instance ID override",
"type": "string"
}
}
} | — | — · — | — |
get_forecastGet a capacity forecast for one metric: current trajectory and projected time until the resource ceiling is hit. Metric kinds: opsPerSec, usedMemory, cpuTotal, memFragmentation. Use for capacity planning ("when does memory run out at current growth?").Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"metricKind": {
"type": "string",
"enum": [
"opsPerSec",
"usedMemory",
"cpuTotal",
"memFragmentation"
],
"description": "Metric to forecast"
},
"instanceId": {
"description": "Optional instance ID override",
"type": "string"
}
},
"required": [
"metricKind"
]
} | — | — · — | — |
get_healthGet a synthetic health summary for the active instance: keyspace hit rate, memory fragmentation ratio, connected clients, replication lag (replicas only), and keyspace size. Use this as the first call when investigating an instance — it surfaces the most actionable signals without requiring you to parse raw INFO output.Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"instanceId": {
"description": "Optional instance ID override",
"type": "string"
}
}
} | — | — · — | — |
get_hot_keysGet hot key tracking data from persisted storage. BetterDB periodically scans keys using LFU frequency scores (when maxmemory-policy is an LFU variant) or OBJECT IDLETIME / COMMANDLOG-derived frequency. Each snapshot captures the top keys ranked by access frequency. Use this to find cache-busting keys, uneven access patterns, or keys that dominate throughput. The signalType field in each entry indicates which detection mode was active (lfu or idletime).Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"startTime": {
"description": "Start time (Unix timestamp ms)",
"type": "number"
},
"endTime": {
"description": "End time (Unix timestamp ms)",
"type": "number"
},
"limit": {
"description": "Max entries to return (default 50, max 200)",
"type": "number"
},
"instanceId": {
"description": "Optional instance ID override",
"type": "string"
}
}
} | — | — · — | — |
get_inference_latencyGet the FT.SEARCH latency profile: p50/p95/p99 per vector index over the sampling window, plus SLA breach status per index. sla is null when BetterDB Pro inference SLA monitoring is absent or unlicensed, and an empty array when it is active with no indexes configured. More specific than get_latency, which covers general command latency. Use to answer "are vector searches meeting their latency budget?".Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"windowMs": {
"description": "Profile window in whole milliseconds, minimum 1000 (service default if omitted)",
"type": "integer",
"minimum": 1000,
"maximum": 9007199254740991
},
"instanceId": {
"description": "Optional instance ID override",
"type": "string"
}
}
} | — | — · — | — |
get_infoGet INFO stats for the active instance. Contains all health data: memory, clients, replication, keyspace, stats (hit rate, ops/sec), and server info. Optionally filter to a section: server|clients|memory|stats|replication|keyspace.Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"section": {
"description": "INFO section to filter (server, clients, memory, stats, replication, keyspace)",
"type": "string"
},
"instanceId": {
"description": "Optional instance ID override",
"type": "string"
}
}
} | — | — · — | — |
get_largest_keysGet the largest keys from key analytics snapshots, ranked by measured memory usage. Coverage note: snapshots track the biggest collections by element count, so a memory-heavy key with few elements may not be tracked. Companion to get_hot_keys, which ranks by access frequency. Use to find memory hogs, bloated hashes/sets, or candidates for TTL/eviction. Requires BetterDB Pro (keyAnalytics).Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"limit": {
"description": "Max keys to return (default 50)",
"type": "number"
},
"startTime": {
"description": "Start time (Unix timestamp ms)",
"type": "number"
},
"endTime": {
"description": "End time (Unix timestamp ms)",
"type": "number"
},
"instanceId": {
"description": "Optional instance ID override",
"type": "string"
}
}
} | — | — · — | — |
get_latencyGet latency event history for the active instance.Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"instanceId": {
"description": "Optional instance ID override",
"type": "string"
}
}
} | — | — · — | — |
get_latency_historyGet the full latency history for a named event (e.g. 'command', 'fast-command'). Call get_latency first to see which event names are available, then use this to investigate a specific event's trend over time.Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"eventName": {
"type": "string",
"pattern": "^[a-zA-Z0-9_.-]+$",
"description": "Latency event name to query"
},
"instanceId": {
"description": "Optional instance ID override",
"type": "string"
}
},
"required": [
"eventName"
]
} | — | — · — | — |
get_latency_regressionsGet detected latency regressions (sustained p99 command-latency degradations vs baseline) from persisted storage. Companion to get_anomalies: same event store, pre-filtered to latency regressions. Use when investigating "the database got slower".Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"limit": {
"description": "Max events to return (default 100)",
"type": "number"
},
"startTime": {
"description": "Start time (Unix timestamp ms, default 24h ago)",
"type": "number"
},
"instanceId": {
"description": "Optional instance ID override",
"type": "string"
}
}
} | — | — · — | — |
get_memoryGet memory diagnostics: MEMORY DOCTOR assessment and MEMORY STATS breakdown.Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"instanceId": {
"description": "Optional instance ID override",
"type": "string"
}
}
} | — | — · — | — |
get_slot_statsGet per-slot key counts and CPU usage (Valkey 8.0+ only). Use orderBy='cpu-usec' to find hot slots, or 'key-count' to find the most populated slots. Returns an error message if not supported.Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"orderBy": {
"description": "Sort order: 'key-count' or 'cpu-usec' (default 'key-count')",
"type": "string",
"enum": [
"key-count",
"cpu-usec"
]
},
"limit": {
"description": "Max slots to return (default 20)",
"type": "number"
},
"instanceId": {
"description": "Optional instance ID override",
"type": "string"
}
}
} | — | — · — | — |
get_slowlogGet the most recent slow commands from the slowlog.Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"count": {
"description": "Number of entries to return (default 25)",
"type": "number"
},
"instanceId": {
"description": "Optional instance ID override",
"type": "string"
}
}
} | — | — · — | — |
get_slowlog_patternsGet analyzed slowlog patterns from persisted storage. Groups slow commands by normalized pattern, showing frequency, average duration, and example commands. Survives slowlog buffer rotation — data goes back as far as BetterDB has been running.Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"limit": {
"description": "Max entries to analyze",
"type": "number"
},
"instanceId": {
"description": "Optional instance ID override",
"type": "string"
}
}
} | — | — · — | — |
get_vector_indexesGet health details for every vector search index on the instance: document count, memory usage, indexing failures, and percent indexed. Requires the Search module (valkey-search / RediSearch) on the connection — errors clearly if absent. Use to diagnose incomplete indexing or index memory growth.Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"instanceId": {
"description": "Optional instance ID override",
"type": "string"
}
}
} | — | — · — | — |
list_ai_tracesList recent AI application traces ingested via OpenTelemetry (LLM calls, cache lookups, memory recalls, retrieval spans). Not tied to a Valkey instance — traces come from instrumented AI apps. Use get_ai_trace for a full span waterfall and correlate_ai_trace to join a trace with live Valkey state.Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"hours": {
"description": "Look-back window in whole hours, 1-168 (default 1)",
"type": "integer",
"minimum": 1,
"maximum": 168
},
"service": {
"description": "Filter by emitting service name",
"type": "string"
},
"limit": {
"description": "Max traces to return, 1-1000 (default 100)",
"type": "integer",
"minimum": 1,
"maximum": 1000
}
}
} | — | — · — | — |
list_instancesList all Valkey/Redis instances registered in BetterDB. Shows connection status and capabilities.Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {}
} | — | — · — | — |
memory_approve_forgetApprove a pending forget proposal, applying the deletion against the live store.Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"proposal_id": {
"type": "string",
"minLength": 1,
"description": "The proposal id (from memory_forget or memory_list_pending_forgets)"
},
"actor": {
"description": "Who is approving (recorded in the audit log)",
"type": "string"
},
"instanceId": {
"description": "Optional instance ID override",
"type": "string"
}
},
"required": [
"proposal_id"
]
} | — | — · — | — |
memory_forgetPropose forgetting memories (by id, or by scope/tags). Creates a pending proposal that a human must approve before anything is deleted.Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"memory_name": {
"type": "string",
"minLength": 1,
"description": "The memory store name (from memory_stores)"
},
"id": {
"description": "Forget a single memory by id",
"type": "string"
},
"threadId": {
"description": "Scope: thread id",
"type": "string"
},
"agentId": {
"description": "Scope: agent id",
"type": "string"
},
"namespace": {
"description": "Scope: namespace",
"type": "string"
},
"tags": {
"description": "Scope: forget memories carrying all these tags",
"type": "array",
"items": {
"type": "string"
}
},
"reasoning": {
"type": "string",
"minLength": 20,
"description": "Why these memories should be forgotten (min 20 chars)"
},
"instanceId": {
"description": "Optional instance ID override",
"type": "string"
}
},
"required": [
"memory_name",
"reasoning"
]
} | — | — · — | — |
memory_getFetch a single memory by ID from a store.Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"memory_name": {
"type": "string",
"minLength": 1,
"description": "The memory store name (from memory_stores)"
},
"id": {
"type": "string",
"minLength": 1,
"description": "The memory ID"
},
"instanceId": {
"description": "Optional instance ID override",
"type": "string"
}
},
"required": [
"memory_name",
"id"
]
} | — | — · — | — |
memory_listList memories in a store, newest first, with optional scope and tag filters.Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"memory_name": {
"type": "string",
"minLength": 1,
"description": "The memory store name (from memory_stores)"
},
"threadId": {
"description": "Filter by thread ID",
"type": "string"
},
"agentId": {
"description": "Filter by agent ID",
"type": "string"
},
"namespace": {
"description": "Filter by namespace",
"type": "string"
},
"tags": {
"description": "Filter by tags (AND)",
"type": "array",
"items": {
"type": "string"
}
},
"limit": {
"description": "Max results (default 20)",
"type": "integer",
"minimum": 1,
"maximum": 100
},
"offset": {
"description": "Pagination offset",
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"instanceId": {
"description": "Optional instance ID override",
"type": "string"
}
},
"required": [
"memory_name"
]
} | — | — · — | — |
memory_list_pending_forgetsList pending forget proposals awaiting approval on an instance.Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"memory_name": {
"description": "Filter by memory store name",
"type": "string"
},
"limit": {
"description": "Max results (default 50)",
"type": "integer",
"minimum": 1,
"maximum": 200
},
"instanceId": {
"description": "Optional instance ID override",
"type": "string"
}
}
} | — | — · — | — |
memory_recallRecall memories from a store by a precomputed query vector (the caller supplies the embedding).Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"memory_name": {
"type": "string",
"minLength": 1,
"description": "The memory store name (from memory_stores)"
},
"vector": {
"minItems": 1,
"type": "array",
"items": {
"type": "number"
},
"description": "Precomputed query embedding"
},
"k": {
"description": "Max results",
"type": "integer",
"minimum": 1,
"maximum": 100
},
"threshold": {
"description": "Max cosine distance",
"type": "number",
"minimum": 0,
"maximum": 2
},
"tags": {
"description": "Filter by tags (AND)",
"type": "array",
"items": {
"type": "string"
}
},
"threadId": {
"description": "Filter by thread ID",
"type": "string"
},
"agentId": {
"description": "Filter by agent ID",
"type": "string"
},
"namespace": {
"description": "Filter by namespace",
"type": "string"
},
"instanceId": {
"description": "Optional instance ID override",
"type": "string"
}
},
"required": [
"memory_name",
"vector"
]
} | — | — · — | — |
memory_reject_forgetReject a pending forget proposal without deleting anything.Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"proposal_id": {
"type": "string",
"minLength": 1,
"description": "The proposal id"
},
"reason": {
"description": "Why the proposal is being rejected",
"type": "string"
},
"actor": {
"description": "Who is rejecting (recorded in the audit log)",
"type": "string"
},
"instanceId": {
"description": "Optional instance ID override",
"type": "string"
}
},
"required": [
"proposal_id"
]
} | — | — · — | — |
memory_statsGet item count, eviction count, and live config for a memory store.Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"memory_name": {
"type": "string",
"minLength": 1,
"description": "The memory store name (from memory_stores)"
},
"instanceId": {
"description": "Optional instance ID override",
"type": "string"
}
},
"required": [
"memory_name"
]
} | — | — · — | — |
memory_storesList agent-memory stores discovered on an instance (name, capabilities, stats key).Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"instanceId": {
"description": "Optional instance ID override",
"type": "string"
}
}
} | — | — · — | — |
remove_connectionRemove a connection from BetterDB.Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"instanceId": {
"type": "string",
"pattern": "^[a-zA-Z0-9_-]+$",
"description": "The instance ID to remove"
}
},
"required": [
"instanceId"
]
} | — | — · — | — |
select_instanceSelect which instance subsequent tool calls operate on.Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"instanceId": {
"type": "string",
"pattern": "^[a-zA-Z0-9_-]+$",
"description": "The instance ID to select"
}
},
"required": [
"instanceId"
]
} | — | — · — | — |
set_default_connectionSet a connection as the active default for BetterDB.Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"instanceId": {
"type": "string",
"pattern": "^[a-zA-Z0-9_-]+$",
"description": "The instance ID to set as default"
}
},
"required": [
"instanceId"
]
} | — | — · — | — |
start_monitorStart the BetterDB monitor as a persistent background process. If already running, returns the existing URL. The monitor persists across MCP sessions and must be stopped explicitly with stop_monitor.Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"port": {
"default": 3001,
"description": "Port for the monitor API (default 3001)",
"type": "integer",
"minimum": 1,
"maximum": 65535
},
"storage": {
"default": "sqlite",
"description": "Storage backend (default sqlite)",
"type": "string",
"enum": [
"sqlite",
"memory"
]
}
}
} | — | — · — | — |
stop_monitorStop a persistent BetterDB monitor process that was previously started with start_monitor or --autostart --persist.Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {}
} | — | — · — | — |
test_connectionTest a Valkey/Redis connection without persisting it. Use before add_connection to validate credentials.Input schema{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Display name for the connection"
},
"host": {
"type": "string",
"description": "Hostname or IP address"
},
"port": {
"default": 6379,
"description": "Port number",
"type": "integer",
"minimum": 1,
"maximum": 65535
},
"username": {
"description": "ACL username (default: \"default\")",
"type": "string"
},
"password": {
"description": "Auth password",
"type": "string"
}
},
"required": [
"name",
"host"
]
} | — | — · — | — |