generate_file_upload_url
Generate a presigned URL to upload files for use in Opus workflow automation jobs, providing both upload and reference URLs.
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 handler function that makes an API call to generate presigned URLs for file upload and returns the results formatted for MCP.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:157-173 (schema)Input schema defining the 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:153-174 (registration)Tool registration in the list returned by getTools(), including name, description, and input schema.{ 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:84-85 (registration)Dispatch case in the CallToolRequestSchema handler that routes calls to the generateFileUploadUrl method.case "generate_file_upload_url": return await this.generateFileUploadUrl(args);