Skip to main content
Glama
wrediam

Better Qdrant MCP Server

list_collections

Retrieve all available Qdrant collections for managing and organizing vector database content in the Better Qdrant MCP Server.

Instructions

List all available Qdrant collections

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The primary handler function for the 'list_collections' MCP tool. It invokes the Qdrant service to list collections, formats the result as JSON text response, and handles errors appropriately.
    private async handleListCollections() {
      try {
        const collections = await this.qdrantService.listCollections();
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(collections, null, 2),
            },
          ],
        };
      } catch (error) {
        console.error('Error in handleListCollections:', error);
        
        let errorDetails = '';
        if (error instanceof Error) {
          errorDetails = `${error.name}: ${error.message}\nStack: ${error.stack}`;
        } else {
          errorDetails = String(error);
        }
        
        return {
          content: [
            {
              type: 'text',
              text: `Error listing collections: ${errorDetails}`,
            },
          ],
          isError: true,
        };
      }
    }
  • src/index.ts:108-116 (registration)
    Registration of the 'list_collections' tool in the MCP server, including name, description, and empty input schema (no parameters required).
    {
      name: 'list_collections',
      description: 'List all available Qdrant collections',
      inputSchema: {
        type: 'object',
        properties: {},
        required: [],
      },
    },
  • The core implementation of listing collections via direct HTTP fetch to Qdrant API /collections endpoint, extracting collection names.
    async listCollections(): Promise<string[]> {
      try {
        console.log('Attempting to connect to Qdrant server using direct fetch...');
        
        // Use direct fetch instead of the client
        const collectionsUrl = `${this.url}/collections`;
        console.log(`Fetching from: ${collectionsUrl}`);
        
        const response = await fetch(collectionsUrl, {
          method: 'GET',
          headers: {
            'Content-Type': 'application/json',
            ...(this.apiKey ? { 'api-key': this.apiKey } : {})
          },
          // @ts-ignore - node-fetch supports timeout
          timeout: 5000 // 5 second timeout
        });
        
        if (!response.ok) {
          throw new Error(`HTTP error! Status: ${response.status}`);
        }
        
        const data = await response.json() as { 
          result: { 
            collections: Array<{ name: string }> 
          } 
        };
        console.log('Successfully retrieved collections:', data);
        
        return data.result.collections.map(c => c.name);
      } catch (error) {
        console.error('Error in listCollections:', error);
        if (error instanceof Error) {
          console.error(`${error.name}: ${error.message}`);
          console.error('Stack:', error.stack);
        }
        throw error;
      }
    }
  • TypeScript interface definition for the listCollections method in QdrantService, specifying return type as Promise<string[]>.
    listCollections(): Promise<string[]>;
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. While 'List all available Qdrant collections' implies a read-only operation, it doesn't specify important behavioral details like whether this requires authentication, what format the results come in, if there are rate limits, or how large collections are handled. The description is minimal and lacks operational context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that states exactly what the tool does with no wasted words. It's front-loaded with the core functionality and appropriately sized for a simple listing operation. Every word earns its place in conveying the essential purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with no annotations, no output schema, and zero parameters, the description is insufficiently complete. While it states what the tool does, it doesn't provide enough context about the operation's behavior, result format, or integration considerations. The agent would need to guess about important operational details that aren't covered.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters, and schema description coverage is 100% (empty schema is fully described). The description appropriately doesn't discuss parameters since none exist. This meets the baseline expectation for a parameterless tool, though it doesn't add any parameter-related value beyond what the schema already provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('List') and resource ('Qdrant collections'), making the purpose immediately understandable. It specifies 'all available' collections, which adds useful scope information. However, it doesn't explicitly differentiate from sibling tools like 'search' or 'delete_collection', which would require more specific comparison.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'search' or 'delete_collection'. There's no mention of prerequisites, typical use cases, or scenarios where this tool would be preferred over others. The agent must infer usage from the tool name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

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/wrediam/better-qdrant-mcp-server'

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