generate_file_upload_url
Creates a secure, temporary upload link for files to be used in Opus workflow automation, specifying file type and access permissions.
Instructions
Generate presigned URL for file upload. Returns presignedUrl (for uploading) and fileUrl (to reference in job execution)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fileExtension | Yes | File extension with dot (e.g., .pdf, .jpeg, .png, .docx, .csv, .xlsx, .txt, .json, .html, .xml) | |
| accessScope | No | Access scope for the file | organization |
Implementation Reference
- src/index.ts:278-302 (handler)The main handler function for the generate_file_upload_url tool. It makes a POST request to the Opus API endpoint /job/file/upload to generate presigned URLs for file upload and returns them in the MCP response format.private async generateFileUploadUrl(args: any) { const { fileExtension, accessScope = "organization" } = args; const response = await this.axiosInstance.post("/job/file/upload", { fileExtension, accessScope, }); return { content: [ { type: "text", text: JSON.stringify( { presignedUrl: response.data.presignedUrl, fileUrl: response.data.fileUrl, instructions: "Use presignedUrl to upload file via PUT request (no auth headers). Use fileUrl in job execution payload.", }, null, 2 ), }, ], }; }
- src/index.ts:153-174 (registration)Tool registration in the getTools() method, including name, description, and input schema definition.{ name: "generate_file_upload_url", description: "Generate presigned URL for file upload. Returns presignedUrl (for uploading) and fileUrl (to reference in job execution)", inputSchema: { type: "object", properties: { fileExtension: { type: "string", description: "File extension with dot (e.g., .pdf, .jpeg, .png, .docx, .csv, .xlsx, .txt, .json, .html, .xml)", }, accessScope: { type: "string", enum: ["all", "user", "workspace", "organization"], description: "Access scope for the file", default: "organization", }, }, required: ["fileExtension"], }, },
- src/index.ts:157-173 (schema)Input schema defining parameters for the generate_file_upload_url tool: fileExtension (required) and accessScope (optional).inputSchema: { type: "object", properties: { fileExtension: { type: "string", description: "File extension with dot (e.g., .pdf, .jpeg, .png, .docx, .csv, .xlsx, .txt, .json, .html, .xml)", }, accessScope: { type: "string", enum: ["all", "user", "workspace", "organization"], description: "Access scope for the file", default: "organization", }, }, required: ["fileExtension"], },
- src/index.ts:84-85 (handler)Dispatch in the CallToolRequestSchema handler that routes calls to the generateFileUploadUrl method.case "generate_file_upload_url": return await this.generateFileUploadUrl(args);