Skip to main content
Glama
match-formatter.ts709 B
import {trimWithEllipsis} from '../../../markdown.js'; import type {RankedReference} from '../types.js'; import type {ServerContext} from '../../../context.js'; export const buildMatchLines = (matches: RankedReference[], client: ServerContext['client']): string[] => { const lines: string[] = []; for (const match of matches) { lines.push(`### ${match.ref.title}`); if (match.ref.kind) { lines.push(` • **Kind:** ${match.ref.kind}`); } lines.push(` • **Path:** ${match.ref.url}`); const abstractText: string = client.extractText(match.ref.abstract ?? []); if (abstractText) { lines.push(` ${trimWithEllipsis(abstractText, 180)}`); } lines.push(''); } return lines; };

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/MightyDillah/apple-doc-mcp'

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