Skip to main content
Glama

GenAIScript

Official
by microsoft
MIT License
43
2,820
  • Linux
  • Apple
linters.genai.mts1.87 kB
script({ title: "Linters", systemSafety: false, system: ["system", "system.assistant", "system.annotations", "system.diagrams"], responseType: "markdown", tools: [ "agent_fs", "agent_git", "agent_github", "agent_planner", "agent_docs", "agent_interpreter", ], parameters: { base: { type: "string", description: "The base commit to compare against.", default: "HEAD^", }, }, }) const { vars, dbg, output } = env const base = vars.base || (await git.defaultBranch()) const linters = await workspace.findFiles("genaisrc/linters/*.md") if (!linters) cancel("no linters found in genaisrc/linters/*.md") dbg(`found %d linters`, linters.length) const changes = await git.diff({ base, llmify: true, ignoreSpaceChange: true, }) if (!changes) cancel("nothing changed") const diff = def("DIFF", changes, { language: "diff", maxTokens: 7000, detectPromptInjection: "available", }) dbg(changes) $`You are an expert in code linting. You will be provided a list of linters and you will apply them to the code in the ${diff} variable using the strategy below. ## Strategy for each linter: read the linter description apply the linter to the code in ${diff} report any errors or warnings using annotations format. Use the linter name in the description. ## Linters `.role("system") for (const linter of linters) { const name = path.changeext(path.basename(linter.filename), "") const content = MD.content(linter) // scale down each title by 2 const patched = content.replace(/^(#+)/gm, (m) => `##${m}`) $`### Linter: ${name}`.role("system") writeText(patched, { role: "system" }) } $`## Output Use the full power of GitHub Flavored Markdown to create a glorious response. `.role("system")

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