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

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

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;
      }
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states the tool tests a connection but doesn't disclose behavioral traits like what 'test' entails (e.g., ping, auth check, latency measurement), potential side effects, error handling, or output format. This is a significant gap for a tool with zero annotation coverage.

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 with zero waste. It's front-loaded and appropriately sized for a simple tool, earning its place by stating the core purpose without redundancy.

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?

Given the tool's simplicity (0 params, no output schema) and lack of annotations, the description is incomplete. It doesn't explain what the test involves, what results to expect, or how it fits with siblings, leaving the agent under-informed about behavioral context.

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 0 parameters, and schema description coverage is 100%, so no parameter documentation is needed. The description doesn't add param info, but that's appropriate here. Baseline is 4 for 0 params, as it avoids unnecessary details.

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 action ('Test') and target resource ('connection to the embedding service'), providing a specific verb+resource combination. However, it doesn't distinguish this tool from its siblings (like get_stats or other diagnostic tools), which would require a 5.

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. It doesn't mention prerequisites, timing (e.g., after setup or when errors occur), or comparisons to sibling tools like get_stats, leaving the agent with minimal context for selection.

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

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