Skip to main content
Glama

upload_attachment_by_url

Upload files to NocoDB storage directly from web URLs, enabling AI agents to attach documents and media to database records without manual file handling.

Instructions

Upload files to NocoDB storage from URLs

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlsYesArray of URLs to upload
storage_pathNoOptional path in NocoDB storage

Implementation Reference

  • The async handler function for the 'upload_attachment_by_url' tool. It takes NocoDBClient and args, calls client.uploadByUrl, and returns formatted success or error response.
    handler: async ( client: NocoDBClient, args: { urls: string[]; storage_path?: string; }, ) => { try { const result = await client.uploadByUrl(args.urls, args.storage_path); return { success: true, urls_count: args.urls.length, upload_result: result, message: "Files uploaded successfully from URLs", }; } catch (error: any) { return { success: false, error: error.message, urls: args.urls, }; } },
  • Input JSON Schema for the tool, requiring 'urls' as array of strings, optional 'storage_path'.
    inputSchema: { type: "object", properties: { urls: { type: "array", description: "Array of URLs to upload", items: { type: "string", }, }, storage_path: { type: "string", description: "Optional path in NocoDB storage", }, }, required: ["urls"], },
  • src/index.ts:55-62 (registration)
    MCP server registers tools by combining attachmentTools (including upload_attachment_by_url) into allTools array, used in ListToolsRequestSchema and CallToolRequestSchema handlers.
    const allTools = [ ...databaseTools, ...tableTools, ...recordTools, ...viewTools, ...queryTools, ...attachmentTools, ];
  • Supporting method in NocoDBClient that formats URL data and POSTs to NocoDB's /api/v2/storage/upload-by-url endpoint to perform the upload.
    async uploadByUrl(urls: string[], storagePath?: string): Promise<any> { const urlData = urls.map((url) => ({ url })); const data = storagePath ? { urls: urlData, path: storagePath } : urlData; const response = await this.client.post( "/api/v2/storage/upload-by-url", data, ); return response.data; }

Latest Blog Posts

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/andrewlwn77/nocodb-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server