UNPKG

gaia-vault-mcp

Version:

Azure Blob Storage MCP server for AI assistants

61 lines (60 loc) 2.71 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.tools = void 0; const zod_1 = require("zod"); const upload_blob_1 = __importDefault(require("../tools/upload-blob")); const download_blob_1 = __importDefault(require("../tools/download-blob")); const list_blobs_1 = __importDefault(require("../tools/list-blobs")); exports.tools = [ { name: "upload-blob", description: "Upload content to Azure Blob Storage", parameters: zod_1.z.object({ containerName: zod_1.z.string().describe("Name of the Azure Blob container"), blobName: zod_1.z.string().describe("Name of the blob in Azure Storage"), filePath: zod_1.z.string().optional().describe("Path to the file to upload"), textContent: zod_1.z.string().optional().describe("Text content to upload"), }), execute: async (args) => { if (!args.filePath && !args.textContent) { throw new Error("Either filePath or textContent must be provided"); } return await (0, upload_blob_1.default)(args.containerName, args.blobName, { filePath: args.filePath, textContent: args.textContent, }); }, }, { name: "download-blob", description: "Download content from Azure Blob Storage", parameters: zod_1.z.object({ containerName: zod_1.z.string().describe("Name of the Azure Blob container"), blobName: zod_1.z.string().describe("Name of the blob in Azure Storage"), pathFile: zod_1.z.string().optional().describe("Local path to save the downloaded file"), asText: zod_1.z.boolean().optional().describe("Whether to return the content as text instead of saving to file"), }), execute: async (args) => { if (!args.pathFile && !args.asText) { throw new Error("Either pathFile or asText must be provided"); } return await (0, download_blob_1.default)(args.containerName, args.blobName, { pathFile: args.pathFile, asText: args.asText, }); }, }, { name: "list-blobs", description: "List all blobs in an Azure Storage container", parameters: zod_1.z.object({ containerName: zod_1.z.string().describe("Name of the Azure Blob container"), }), execute: async (args) => { return await (0, list_blobs_1.default)(args.containerName); }, }, ];