Get Artifact Download Url In Experiment
Get a fetchable URL for the bytes of a binary artifact.
Use this tool when the caller needs the actual content of an image or file artifact, for example to view a plot logged during an experiment. Tool results are text, so this returns a URL to fetch rather than the bytes themselves.
When to Use:
- Call this after
list_artifacts_in_experimentorget_artifact_in_experimentidentifies an artifact whosekindis a media family such asimage, rather thanvalueortimeseries. - Call this when the user asks to see, open, or download a logged file or image.
Constraints:
- Scalar and timeseries artifacts carry their data in
get_artifact_in_experimentalready and are rejected here with422. - Pre-signed URLs expire. Re-call this tool instead of reusing a stale URL.
Notes:
- For artifacts stored inline rather than in object storage, the returned
URL is a relative API path and
requires_auth_headeris true, which means it must be fetched with the caller’sauthorizationheader. - Surface the URL to the user; do not attempt to inline binary content into agent-facing output.
Args: experiment_id: Parent experiment identifier. artifact_name: Artifact key within experiment metrics. user: Authenticated user resolved from the API key. db: Active database session.
Returns: The artifact name, MIME type, and a URL from which the bytes can be fetched.
Raises:
HTTPException: Raised with 404 when the experiment is unavailable to
the caller or the artifact key is missing, or 422 when the
artifact holds no binary content.
Authorizations
Path Parameters
Query Parameters
Response
Successful Response
Represent a fetchable location for artifact bytes.
MCP tool results are text, so artifact bytes are never inlined. This model hands back a URL the caller can fetch directly instead.
Attributes:
name: Artifact key within experiment metrics.
mime_type: MIME type of the stored artifact.
download_url: Absolute pre-signed URL for S3-backed artifacts, or the
relative API path for artifacts still stored inline.
requires_auth_header: Whether download_url needs the caller's
authorization header. Pre-signed URLs do not.
expires_in_seconds: Lifetime of a pre-signed URL, when applicable.
context: Guidance on how to use the returned URL.