Skip to main content
Glama

CodeAnalysis MCP Server

by 0xjcf
toolServiceNoTool.test.ts1.07 kB
/** * Isolated Test for Tool Execution Service - No Tool Selected Case * * This file contains a specific test for the case where a tool execution is attempted * without selecting a tool first. */ import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'; import { ToolExecutionService } from '../state/services/toolService'; import { clearSession, getSessionIds } from '../state/machines/toolMachine'; describe('ToolExecutionService - No Tool Selected', () => { beforeEach(() => { vi.resetAllMocks(); // Clear all sessions getSessionIds().forEach(clearSession); }); afterEach(() => { vi.resetAllMocks(); }); it('should reject when no tool is selected', async () => { const mockExecuteFunction = vi.fn(); const emptyService = new ToolExecutionService(); // Just check that it rejects with an Error object await expect(emptyService.execute(mockExecuteFunction)) .rejects .toThrow(); // Verify the mock was not called expect(mockExecuteFunction).not.toHaveBeenCalled(); }); });

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/0xjcf/MCP_CodeAnalysis'

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