Skip to main content
Glama

add_connection

Add a new Valkey or Redis connection to BetterDB for observability and monitoring. Optionally set it as the active default connection.

Instructions

Add a new Valkey/Redis connection to BetterDB. Optionally set it as the active default.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesDisplay name for the connection
hostYesHostname or IP address
portNoPort number
usernameNoACL username (default: "default")
passwordNoAuth password
setAsDefaultNoSet this connection as the active default

Implementation Reference

  • Implementation of the 'add_connection' MCP tool, which makes a POST request to the API to register a new connection.
    server.tool(
      'add_connection',
      'Add a new Valkey/Redis connection to BetterDB. Optionally set it as the active default.',
      {
        name: z.string().describe('Display name for the connection'),
        host: z.string().describe('Hostname or IP address'),
        port: z.number().int().min(1).max(65535).default(6379).describe('Port number'),
        username: z.string().optional().describe('ACL username (default: "default")'),
        password: z.string().optional().describe('Auth password'),
        setAsDefault: z.boolean().optional().describe('Set this connection as the active default'),
      },
      async (params) => {
        try {
          const data = await apiRequest('POST', '/connections', params) as { id: string };
          if (isLicenseError(data)) {
            return { content: [{ type: 'text' as const, text: licenseErrorResult(data) }] };
          }
          return {
            content: [{ type: 'text' as const, text: `Added connection: ${params.name} (${data.id})` }],
          };
        } catch (err) {
          return {
            content: [{ type: 'text' as const, text: err instanceof Error ? err.message : String(err) }],
            isError: true,
          };
        }
      },
    );

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