Skip to main content
Glama
by microsoft
azure-blobs.genai.mts1.41 kB
import { BlobServiceClient } from "@azure/storage-blob" import { DefaultAzureCredential } from "@azure/identity" import { buffer } from "node:stream/consumers" script({ parameters: { account: { description: "Azure Storage Account Name", default: "genaiscript", type: "string", }, container: { description: "Azure Storage Container Name", default: "images", type: "string", }, }, }) const { account, container } = env.vars const url = `https://${account}.blob.core.windows.net` console.log(`analyzing images in ${account}/${container} at ${url}`) const blobServiceClient = new BlobServiceClient( url, new DefaultAzureCredential() ) const containerClient = blobServiceClient.getContainerClient(container) for await (const blob of containerClient.listBlobsFlat()) { console.log(`blob: ` + blob.name) const blockBlobClient = containerClient.getBlockBlobClient(blob.name) const downloadBlockBlobResponse = await blockBlobClient.download(0) const body = await downloadBlockBlobResponse.readableStreamBody const image = await buffer(body) const res = await runPrompt(_ => { _.defImages(image, { detail: "low" }) _.$`Describe the images.` }) def("IMAGES_SUMMARY", { filename: blob.name, content: res.text }) } $`Summarize IMAGES_SUMMARY.`

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