Skip to main content
Glama

upload_file_from_url

Upload files to Ed Discussion from public URLs, generating static links for course materials and attachments.

Instructions

Upload a file to Ed from a URL, returns the static file link

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesPublic URL of the file to upload

Implementation Reference

  • The implementation of the logic to upload a file from a URL. Note: I need to verify if the return is just the string or the property from res. I will read a bit more to be sure of the return.
    async uploadFileFromUrl(url: string): Promise<string> {
      // Restrict to HTTPS to mitigate SSRF (block file://, ftp://, internal schemes)
      const parsed = new URL(url);
      if (parsed.protocol !== "https:") {
        throw new Error("Only https:// URLs are allowed for file uploads");
      }
      const res = await this.request<EdFileResponse>("POST", "files/url", { url });
  • src/index.ts:443-455 (registration)
    The registration of the upload_file_from_url tool.
    server.tool(
      "upload_file_from_url",
      "Upload a file to Ed from a URL, returns the static file link",
      { url: z.string().url().describe("Public URL of the file to upload") },
      async ({ url }) => {
        try {
          const link = await api.uploadFileFromUrl(url);
          return msg(`File uploaded: ${link}`);
        } catch (err) {
          return fail(err);
        }
      }
    );
Behavior2/5

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

No annotations provided, so description carries full disclosure burden. While it mentions the return value ('static file link'), it omits critical behavioral details: supported file types, size limits, URL accessibility requirements, timeout behavior, or error handling for invalid URLs.

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?

Single 11-word sentence with zero waste. Front-loaded with action ('Upload a file'), followed by source ('from a URL'), and return value. Every clause earns its place.

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

Completeness3/5

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

Adequate for a single-parameter tool without output schema—description compensates by stating the return type. However, given this is a file upload operation, it should mention supported formats or that the URL must be publicly reachable.

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 has 100% description coverage for the single 'url' parameter. Description adds no additional parameter semantics (e.g., format details, examples), but baseline 3 is appropriate given the schema's completeness.

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

Purpose5/5

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

Description provides specific verb ('Upload'), clear resource ('file'), and target system ('Ed'). Distinct from sibling tools which exclusively handle threads, comments, and users—this is the only file operation tool.

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

Usage Guidelines3/5

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

Lacks explicit 'when to use' guidance or prerequisites (e.g., URL must be publicly accessible). However, as the sole file-handling tool among thread/comment siblings, its purpose is implicitly clear. No alternatives or exclusions mentioned.

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/rob-9/edstem-mcp'

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