Log Artifact In Experiment
Log or append an artifact value under an experiment metrics key.
Use this tool when the caller needs to persist run metadata, scalar values,
time-series points, JSON payloads, or base64 image artifacts under an
experiment. Repeated writes to the same data.name are stored as
timestamp-keyed entries and may later read back as normalized timeseries or
value shapes.
When to Use:
- Call this after a run, optimization, or analysis step when metadata or derived outputs should be attached to an experiment.
- Call this when the workflow needs to persist human-readable notes, numeric values, JSON payloads, or image-like previews.
Constraints:
kindmust be exactly one oftext,value,timeseries,list,dict, orimage.- Repeated writes are stored under timestamp keys in the experiment
metrics map, so read-side responses may normalize to
valueortimeseriesinstead of preserving the write-timekindverbatim.
Notes:
- The route returns an empty
200response on success. - After logging, callers can use
list_artifacts_in_experimentorget_artifact_in_experimentto inspect the normalized MCP read-side artifact shape.
Args:
experiment_id: Parent experiment identifier.
user: Authenticated user resolved from the API key.
data: Artifact payload. kind must be exactly one of text,
value, timeseries, list, dict, or image.
db: Active database session.
Returns:
An empty 200 response when artifact data is persisted.
Raises:
HTTPException: Raised with 404 if the experiment is missing, or
400 for invalid artifact shape such as missing timeseries
points.
Authorizations
Path Parameters
Body
Define payload for logging experiment artifacts from MCP tools.
Logged artifact kinds are accepted on write, but MCP read endpoints expose a
normalized artifact view and do not preserve every submitted kind as a
distinct response shape.
Attributes:
name: Artifact key under which values are stored.
kind: Artifact serialization mode accepted by the logging endpoint.
value: Value payload for non-timeseries kinds.
points: Time series points used when kind='timeseries'.
Artifact type. Use text for strings, value for a single numeric value, timeseries for numeric points in points, list for JSON arrays, dict for JSON objects, and image for a base64 data URL such as data:image/png;base64,....
text, value, timeseries, list, dict, image, file Artifact payload for all kinds except timeseries. Send properly typed JSON values: string for text, number for value, array for list, object for dict, and a base64 data URL string for image. Leave this empty when kind is timeseries.
Time series points to log when kind is timeseries. Each item must have numeric x and y fields. Leave this empty for all other kinds.
Response
Successful Response