Skip to main content
Glama

GenAIScript

Official
by microsoft
MIT License
43
2,820
  • Linux
  • Apple
system.retrieval_web_search.genai.mts1.27 kB
system({ title: "Web Search", description: "Function to do a web search.", }) export default function (ctx: ChatGenerationContext) { const { defTool } = ctx defTool( "retrieval_web_search", "Search the web for a user query using Tavily or Bing Search.", { type: "object", properties: { query: { type: "string", description: "Search query.", }, count: { type: "integer", description: "Number of results to return.", }, }, required: ["query"], }, async (args) => { const { query, count } = args const webPages = await retrieval.webSearch(query, { count, ignoreMissingProvider: true, }) if (!webPages) return "error: no web search provider configured (https://microsoft.github.io/genaiscript/reference/scripts/web-search/)" return YAML.stringify( webPages.map((f) => ({ url: f.filename, content: f.content, })) ) } ) }

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