Skip to main content
Glama

Obsidian Semantic MCP Server

fragments-bugfix.test.ts•1.53 kB
import { describe, it, expect } from '@jest/globals'; import { UniversalFragmentRetriever } from '../src/indexing/fragment-retriever'; describe('Fragment Retriever Bug Fixes', () => { it('should handle undefined query without throwing', async () => { const retriever = new UniversalFragmentRetriever(); // Index a test document await retriever.indexDocument('doc1', 'test.md', 'This is a test document with some content'); // This should not throw await expect(async () => { await retriever.retrieveFragments(undefined as any, { maxFragments: 3 }); }).not.toThrow(); }); it('should handle empty query without throwing', async () => { const retriever = new UniversalFragmentRetriever(); // Index a test document await retriever.indexDocument('doc1', 'test.md', 'This is a test document with some content'); // This should not throw const result = await retriever.retrieveFragments('', { maxFragments: 3 }); expect(result).toBeDefined(); expect(result.result).toBeInstanceOf(Array); }); it('should handle whitespace-only query', async () => { const retriever = new UniversalFragmentRetriever(); // Index a test document await retriever.indexDocument('doc1', 'test.md', 'This is a test document with some content'); // This should not throw const result = await retriever.retrieveFragments(' ', { maxFragments: 3 }); expect(result).toBeDefined(); expect(result.result).toBeInstanceOf(Array); }); });

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/aaronsb/obsidian-semantic-mcp'

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