Skip to main content
Glama

GenAIScript

Official
by microsoft
MIT License
43
2,820
  • Linux
  • Apple
system.retrieval_vector_search.genai.mts1.26 kB
system({ title: "Embeddings Vector Search", description: "Function to do a search using embeddings vector similarity distance.", }) export default function (ctx: ChatGenerationContext) { const { defTool } = ctx defTool( "retrieval_vector_search", "Search files using embeddings and similarity distance.", { type: "object", properties: { files: { description: "array of file paths to search,", type: "array", items: { type: "string", description: "path to the file to search, relative to the workspace root", }, }, q: { type: "string", description: "Search query.", }, }, required: ["q", "files"], }, async (args) => { const { files, q } = args const res = await retrieval.vectorSearch( q, files.map((filename) => ({ filename })) ) return YAML.stringify(res.map(({ filename }) => filename)) } ) }

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