We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/kuro-tomo/shopify-agentic-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
/**
* Tests for src/ucp/discovery.ts — searchCatalog & getProduct
*
* Both functions are placeholder facades returning empty/null results.
* Tests verify the correct structure and async behavior.
*/
import { searchCatalog, getProduct } from '../../src/ucp/discovery.js';
describe('searchCatalog', () => {
it('returns an object with products, total_count, and has_more', async () => {
const result = await searchCatalog({ keyword: 'shoes' });
expect(result).toHaveProperty('products');
expect(result).toHaveProperty('total_count');
expect(result).toHaveProperty('has_more');
});
it('returns an empty products array', async () => {
const result = await searchCatalog({ keyword: 'anything' });
expect(result.products).toEqual([]);
expect(Array.isArray(result.products)).toBe(true);
});
it('returns total_count of 0', async () => {
const result = await searchCatalog({ keyword: 'test' });
expect(result.total_count).toBe(0);
});
it('returns has_more as false', async () => {
const result = await searchCatalog({ keyword: 'test' });
expect(result.has_more).toBe(false);
});
it('does not include a cursor property', async () => {
const result = await searchCatalog({ keyword: 'test' });
expect(result.cursor).toBeUndefined();
});
it('returns a Promise (is async)', () => {
const result = searchCatalog({ keyword: 'test' });
expect(result).toBeInstanceOf(Promise);
});
it('accepts a query with all optional fields', async () => {
const result = await searchCatalog({
keyword: 'sneakers',
category: 'footwear',
price_min: 5000,
price_max: 20000,
available_only: true,
});
expect(result.products).toEqual([]);
expect(result.total_count).toBe(0);
expect(result.has_more).toBe(false);
});
it('accepts an empty query object', async () => {
const result = await searchCatalog({});
expect(result.products).toEqual([]);
expect(result.total_count).toBe(0);
});
it('accepts a second filters argument', async () => {
const result = await searchCatalog(
{ keyword: 'test' },
{ color: 'red', size: 'L' },
);
expect(result.products).toEqual([]);
expect(result.total_count).toBe(0);
});
});
describe('getProduct', () => {
it('returns null for any product ID', async () => {
const result = await getProduct('prod-123');
expect(result).toBeNull();
});
it('returns null for an empty string ID', async () => {
const result = await getProduct('');
expect(result).toBeNull();
});
it('returns null for a Shopify GID format', async () => {
const result = await getProduct('gid://shopify/Product/12345');
expect(result).toBeNull();
});
it('returns a Promise (is async)', () => {
const result = getProduct('any-id');
expect(result).toBeInstanceOf(Promise);
});
it('resolves (does not reject) for arbitrary input', async () => {
await expect(getProduct('random-id-999')).resolves.toBeNull();
});
});