Skip to main content
Glama
scanady
by scanady
metadata.ts1.7 kB
/** * Tool: standards_get_metadata * Gets metadata for standards without loading full content */ import { GetMetadataInput } from '../schemas/metadata.js'; import { ToolResponse } from '../types.js'; import { getMetadataList } from '../services/indexer.js'; import { formatMetadataList } from '../services/parser.js'; /** * Gets metadata for standards matching filter criteria */ export async function getMetadata(params: GetMetadataInput, _extra?: unknown): Promise<ToolResponse> { try { const { filterType, filterTier, filterProcess, filterTags, filterStatus, responseFormat } = params; // Get filtered metadata list const metadataList = getMetadataList({ type: filterType, tier: filterTier, process: filterProcess, tags: filterTags, status: filterStatus, }); if (metadataList.length === 0) { return { content: [ { type: 'text', text: 'No standards found matching the specified criteria.', }, ], structuredContent: { count: 0, standards: [], }, }; } // Format output const outputText = formatMetadataList(metadataList, responseFormat); const structuredOutput = { count: metadataList.length, standards: metadataList, }; return { content: [ { type: 'text', text: outputText, }, ], structuredContent: structuredOutput, }; } catch (error) { return { content: [ { type: 'text', text: `Error retrieving metadata: ${(error as Error).message}`, }, ], isError: true, }; } }

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/scanady/engineering-standards-mcp-server'

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