Skip to main content
Glama

MCP Files

by OrionPotter
importSymbol.test.tsโ€ข1.28 kB
import { describe, expect, it } from 'vitest' import importSymbolTool from '../src/tools/importSymbol.js' describe('importSymbol tool', () => { it('should import a simple built-in module property', async () => { const result = await importSymbolTool.handler({ module_path: 'path', property: 'resolve', }) expect(result).toContain('=== path.resolve ===') expect(result).toContain('function') }) it('should import a utility function', async () => { const result = await importSymbolTool.handler({ module_path: 'path', property: 'join', }) expect(result).toContain('function') }) it('should import fs module constants', async () => { const result = await importSymbolTool.handler({ module_path: 'fs', property: 'constants', }) expect(result).toContain('F_OK') }) it('should throw error for non-existent property', async () => { await expect(importSymbolTool.handler({ module_path: 'path', property: 'nonExistentProperty', })).rejects.toThrow(/not found/) }) it('should throw error for non-existent module', async () => { await expect(importSymbolTool.handler({ module_path: 'this-module-definitely-does-not-exist-12345', })).rejects.toThrow() }) })

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/OrionPotter/flesler-mcp-tools'

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