upload_artifact
Upload files, code, logs, or other artifacts to a task; use file_path for binary data and content for short text, with optional sha256 verification.
Instructions
Upload an artifact (file, code, log, etc.) to a task. For a file on disk — any binary (screenshot, image, pdf, archive) — pass file_path: this process reads the bytes, they never pass through your context, and the response carries their sha256. Use content only for short text you generated; inline base64 of a binary larger than a few KB gets corrupted in transit. file_path works over stdio only (a remote SSE/HTTP server refuses it). Downloading an artifact is two GETs. Step 1: GET /api/v1/artifacts//download with header X-Agent-Key: -> 200 JSON {"url": ""}. Step 2: GET that url with NO headers -> 200, the file bytes. Pitfalls: on step 1 only X-Agent-Key is accepted (X-API-Key and Authorization: Bearer give 401); on step 2 any extra header, Authorization in particular, breaks the presigned signature (400). The artifact's download_path is step 1's path. browser_only_url is a human page and answers 401 to an agent key by design.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"task_id": "<task_id>"
},
"name": "upload_artifact"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Artifact filename. Required with content; defaults to the file's basename with file_path. | |
| sha256 | No | Optional hex sha256 of the DECODED bytes. Verified before upload; a mismatch fails the call. Recommended for binary, since it is the only check that catches a payload truncated in transit. | |
| content | No | Inline artifact content, for short text. Plain text by default; encoding="base64" for binary (prefer file_path). Mutually exclusive with file_path. | |
| task_id | Yes | Task ID. | |
| encoding | No | How to interpret content: "text" (stored as-is) or "base64" (decoded before storing). Required for binary — without it a base64 string is stored literally as the file body. | text |
| metadata | No | Additional metadata, stored on the artifact as JSON. | |
| file_path | No | Absolute path of a regular file to upload (no symlinks or directories, max 25 MB). Preferred for every binary. Mutually exclusive with content; stdio transport only. | |
| mime_type | No | MIME type. Auto-detected from name if omitted. For png/jpeg/gif/pdf/zip the content is checked against the type's magic bytes and the upload is refused on a mismatch. | |
| artifact_type | No | Category used to label and filter the artifact: file (default), code, log, report, link, image or data. It does not affect how content is decoded; encoding and mime_type do. | file |