Skip to main content
Glama
nrwl

Nx MCP Server

Official
by nrwl
generator-details.ts983 B
import { GeneratorCollectionInfo } from '@nx-console/shared-schema'; import { readFile } from 'fs/promises'; import { normalize } from 'path'; export async function getGeneratorSchema( generatorName: string, generators: GeneratorCollectionInfo[], ): Promise<any | undefined> { const generator = generators.find((g) => { if (g.name === generatorName) { return true; } // check to see if the generator name has an alias const [lib, gen] = generatorName.split(':'); if (g.collectionName === lib && g.data?.aliases.some((a) => a === gen)) { return true; } return false; }); if (!generator) { return undefined; } const schemaPath = normalize( generator.schemaPath.replace(/^file:\/\/\//, ''), ); const schema = await readFile(schemaPath, 'utf-8'); const parsedSchema = JSON.parse(schema); delete parsedSchema['$schema']; delete parsedSchema['$id']; parsedSchema.name = generator.name; return parsedSchema; }

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/nrwl/nx-console'

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