Skip to main content
Glama
andrewlwn77
by andrewlwn77

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;
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It states the tool uploads files from URLs but doesn't disclose behavioral traits like authentication requirements, rate limits, file size constraints, supported URL schemes, error handling, or what happens on success/failure. For a mutation tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It's front-loaded with the core action and context, making it easy to parse. Every part of the sentence contributes essential information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given this is a mutation tool with no annotations and no output schema, the description is incomplete. It doesn't explain what the tool returns, error conditions, or important behavioral constraints. While concise, it lacks necessary context for safe and effective use, especially compared to siblings like 'upload_attachment'.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with clear descriptions for both parameters ('urls' and 'storage_path'). The description adds no parameter-specific semantics beyond what the schema provides, such as URL format examples or storage path conventions. Baseline 3 is appropriate since the schema adequately documents parameters, but the description doesn't enhance understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('upload files') and target ('to NocoDB storage from URLs'), which is specific and actionable. It distinguishes from the sibling 'upload_attachment' (which likely handles local files) by specifying 'from URLs', though it doesn't explicitly name alternatives. However, it lacks explicit differentiation from other storage-related tools like 'attach_file_to_record'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention when-not scenarios, prerequisites, or compare with siblings like 'upload_attachment' or 'attach_file_to_record'. The agent must infer usage from the name and description alone without explicit context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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