Skip to main content
Glama

GenAIScript

Official
by microsoft
MIT License
43
2,820
  • Linux
  • Apple
frontmatter.genai.mts1.56 kB
script({ model: "large", accept: ".md,.mdx", parameters: { force: false, }, }) // force refreshing all files const { force, dbg } = env.vars // filter out files that don't have a front matter.description const file = env.files[0] const fm = MD.frontmatter(file.content) if (!force && fm?.description) cancel("file already has description") if (file.content?.includes("autogenerated")) cancel("file is autogenerated") // insert markdown files in context const res = await runPrompt( (ctx) => { ctx.def("FILE", file) // prompt to generate front matter for markdown files ctx.$`##Role You are a search engine optimization expert at creating front matter for markdown document. ## Task Generate the front matter content as the new file content. ## Guidance - Update description as needed. - Update keywords as needed, only 5 keywords or less. - optimize for search engine optimization. - If no front matter is present, generate it. ## Things to avoid - Do NOT repeat project name (GenAIScript) in 'title' field - DO NOT modify the existing 'title' or 'sidebar' fields. - Do NOT use 'Guide' in title. ` }, { responseType: "json_schema", responseSchema: { title: "", description: "", keywords: [""], }, } ) const frontmatter = res.json const { title, description, keywords, tags } = frontmatter file.content = MD.updateFrontmatter(file.content, { title, description, keywords, tags, }) await workspace.writeFiles(file)

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/microsoft/genaiscript'

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