Skip to main content
Glama

list_instances

View all registered Valkey/Redis instances in BetterDB to monitor connection status and available capabilities.

Instructions

List all Valkey/Redis instances registered in BetterDB. Shows connection status and capabilities.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The tool 'list_instances' is defined and registered here, calling the API to fetch instances and formatting the output.
    server.tool(
      'list_instances',
      'List all Valkey/Redis instances registered in BetterDB. Shows connection status and capabilities.',
      {},
      async () => {
        const data = await apiFetch('/mcp/instances') as { instances: Array<{ id: string; name: string; isDefault: boolean; isConnected: boolean; [key: string]: unknown }> };
        const lines = data.instances.map((inst) => {
          const active = inst.id === activeInstanceId ? ' [ACTIVE]' : '';
          const status = inst.isConnected ? 'connected' : 'disconnected';
          return `${inst.id} - ${inst.name} (${status})${inst.isDefault ? ' [default]' : ''}${active}`;
        });
        return {
          content: [{ type: 'text' as const, text: lines.join('\n') || 'No instances found.' }],
        };
      },
    );
    
    server.tool(
      'select_instance',
      'Select which instance subsequent tool calls operate on.',
  • This is the API controller handler that provides the data to the 'list_instances' MCP tool.
    @Get('instances')
    async listInstances() {
      const list = this.registry.list();
      return {
        instances: list.map((c) => ({
          id: c.id,
          name: c.name,
          host: c.host,
          port: c.port,
          isDefault: c.isDefault,

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/BetterDB-inc/monitor'

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