Skip to main content
Glama
generateApi.tsβ€’1.77 kB
interface GenerateApiArgs { projectPath: string; outputPath: string; language: string; } export async function generateApi(args: any) { const { projectPath, outputPath, language } = args as GenerateApiArgs; const instructions: Record<string, string> = { typescript: `πŸ“– TypeScript API Documentation: 1. Install TypeDoc: npm install --save-dev typedoc 2. Generate API docs: npx typedoc --out ${outputPath} ${projectPath} 3. For integration with Docusaurus: npm install --save-dev docusaurus-plugin-typedoc`, javascript: `πŸ“– JavaScript API Documentation: 1. Install JSDoc: npm install --save-dev jsdoc 2. Generate API docs: npx jsdoc -c jsdoc.json -d ${outputPath} ${projectPath} 3. Use JSDoc comments: /** * Description * @param {string} param - Parameter description * @returns {Promise<void>} */`, python: `πŸ“– Python API Documentation: 1. For Sphinx: pip install sphinx sphinx-autodoc 2. Generate API docs: sphinx-apidoc -o ${outputPath} ${projectPath} 3. For MkDocs: pip install mkdocstrings mkdocstrings-python Add to mkdocs.yml: plugins: - mkdocstrings: handlers: python: options: docstring_style: google`, go: `πŸ“– Go API Documentation: 1. Use godoc: godoc -http=:6060 2. Or generate static docs: go doc -all > ${outputPath}/api.md`, rust: `πŸ“– Rust API Documentation: 1. Generate docs: cargo doc --no-deps 2. Open in browser: cargo doc --no-deps --open 3. Output is in target/doc`, }; const instruction = instructions[language] || "Language not supported for API generation"; return { content: [ { type: "text", text: instruction, }, ], }; }

Implementation Reference

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/LiL-Loco/documentation-mcp-server'

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