Skip to main content
Glama

test_connection

Verify connectivity to the embedding service to ensure proper functionality of semantic search and document processing capabilities.

Instructions

Test the connection to the embedding service

Input Schema

NameRequiredDescriptionDefault

No arguments

Input Schema (JSON Schema)

{ "properties": {}, "type": "object" }

Implementation Reference

  • Main handler function for the 'test_connection' tool. Delegates to RAGService.testEmbeddingService() and returns formatted MCP response with connection status.
    private async handleTestConnection() { const isConnected = await this.ragService.testEmbeddingService(); return { content: [ { type: 'text', text: JSON.stringify({ connected: isConnected }, null, 2), }, ], }; }
  • Tool registration entry including schema definition. Defines 'test_connection' tool with empty input schema (no parameters required).
    { name: 'test_connection', description: 'Test the connection to the embedding service', inputSchema: { type: 'object', properties: {}, }, },
  • src/index.ts:275-277 (registration)
    Dispatch registration in CallToolRequestHandler switch statement that routes 'test_connection' calls to the handler.
    case 'test_connection': return await this.handleTestConnection();
  • RAGService helper method that calls EmbeddingService.testConnection() with error handling.
    async testEmbeddingService(): Promise<boolean> { try { return await this.embeddingService.testConnection(); } catch (error) { logger.error(`Embedding service test failed: ${error}`); return false; } }
  • Core test implementation in EmbeddingService. Generates a test embedding and validates its dimension matches expected CONFIG.EMBEDDING_DIMENSION.
    async testConnection(): Promise<boolean> { try { const testEmbedding = await this.generateSingleEmbedding('test'); return testEmbedding.length === CONFIG.EMBEDDING_DIMENSION; } catch (error) { logger.error(`Embedding service test failed: ${error}`); return false; } }

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/santis84/mcp-rag'

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