Skip to main content
Glama

GenAIScript

Official
by microsoft
MIT License
43
2,820
  • Linux
  • Apple
system.md_frontmatter.genai.mts1.02 kB
system({ title: "Markdown frontmatter reader", description: "Register tool that reads the frontmatter of a markdown or MDX file.", }) export default function (ctx: ChatGenerationContext) { const { defTool } = ctx defTool( "md_read_frontmatter", "Reads the frontmatter of a markdown or MDX file.", { type: "object", properties: { filename: { type: "string", description: "Path of the markdown (.md) or MDX (.mdx) file to load, relative to the workspace.", }, }, required: ["filename"], }, async ({ filename, context }) => { try { context.log(`cat ${filename} | frontmatter`) const res = await workspace.readText(filename) return parsers.frontmatter(res.content) ?? "" } catch (e) { return "" } } ) }

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