Skip to main content
Glama

Upload File

upload_file
Destructive

Upload a new file to a course's Files area from base64-encoded content, and return the created file object (id, display_name, size, content_type, download url).

Instructions

Upload a new file to a course's Files area from base64-encoded content, and return the created file object (id, display_name, size, content_type, download url). Each call performs a new upload; check list_files first if you want to avoid creating a duplicate, and use delete_file to remove a file afterward. Canvas handles the upload as a multi-step hand-off to its storage backend (S3 or local Canvas storage), transparent to the caller. parent_folder_path places the file in that folder, creating any missing folder segment along the way; see list_folders for what already exists. Requires permission to manage files in the course.

Input Schema

NameRequiredDescriptionDefault
nameYesFile name including extension
contentYesBase64-encoded file content
course_idYesThe Canvas course ID
content_typeYesMIME type, e.g. "application/pdf" or "image/png"
parent_folder_pathNoDestination folder path within the course, e.g. "subfolder/nested"

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv1.18.15
    • addedInput schema / properties / course_id / anyOf
      Added value: +[
      +  {
      +    "exclusiveMinimum": 0,
      +    "maximum": 9007199254740991,
      +    "type": "integer"
      +  },
      +  {
      +    "pattern": "^[1-9][0-9]{0,18}$",
      +    "type": "string"
      +  }
      +]
    • removedInput schema / properties / course_id / type
      Removed value: -"number"
  2. Changed1 schema field changedv1.18.11
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  3. First observedv1.18.0

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already flag openWorldHint and destructiveHint, but the description adds genuinely useful context: the multi-step storage hand-off is transparent to the caller, the required manage-files permission, and the duplicate-creation risk. It does not go much beyond that (no size limits or failure modes), so a 4 rather than a 5.

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

Conciseness4/5

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

The core action and return value are front-loaded, and the duplicate-check and delete guidance follow. It runs slightly long at five clauses, but every sentence carries actionable information and none is filler.

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

Completeness5/5

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

With no output schema, the description enumerates the returned fields, states the permission requirement, and explains the storage hand-off and folder-creation behavior. An agent has everything needed to invoke it correctly.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description compensates with real added meaning: parent_folder_path auto-creates missing folder segments, and content is base64-encoded. The remaining parameters are already well described in the schema.

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?

States a specific verb and resource ('Upload a new file to a course's Files area') plus the source format and return shape, which clearly distinguishes it from download_file, list_files and delete_file among siblings.

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

Usage Guidelines5/5

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

Explicitly says each call creates a new upload, tells the agent to check list_files first to avoid duplicates, and routes cleanup to delete_file. It also points to list_folders for existing folder structure, so alternatives and conditions are named directly.

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

Deploy Server

Other Tools