Skip to main content
Glama

GetCollections

Retrieve all collections stored in the Astra DB database using the MCP Server, enabling efficient database management and interaction through natural language commands.

Instructions

Get all collections in the Astra DB database

Input Schema

NameRequiredDescriptionDefault

No arguments

Input Schema (JSON Schema)

{ "properties": {}, "required": [], "type": "object" }

Implementation Reference

  • The core handler function that executes the tool logic: lists all collections from the Astra DB using db.listCollections() and returns them.
    export async function GetCollections() { const collections = await db.listCollections(); return collections; }
  • The schema definition for the GetCollections tool, specifying no input parameters.
    { name: "GetCollections", description: "Get all collections in the Astra DB database", inputSchema: { type: "object", properties: {}, required: [], }, },
  • index.ts:61-65 (registration)
    Registration of the ListTools handler which exposes the tools list (including GetCollections schema).
    server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools, }; });
  • index.ts:73-82 (registration)
    The dispatch case in CallToolRequestSchema handler that calls the GetCollections handler and returns formatted response.
    case "GetCollections": const collections = await GetCollections(); return { content: [ { type: "text", text: collections.map((c) => c.name).join("\n"), }, ], };

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/datastax/astra-db-mcp'

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