update-experiment
Rename an MLflow experiment by specifying its experiment ID and a new name.
Instructions
Rename an experiment
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| experimentId | Yes | Experiment ID | |
| newName | Yes | New experiment name |
Implementation Reference
- src/tools/experiments.ts:113-119 (handler)The handler function that executes the update-experiment tool logic. It calls mlflowClient.post('/experiments/update', ...) with experiment_id and new_name.
export async function updateExperiment(params: z.infer<typeof updateExperimentSchema>) { assertWriteAllowed(); return mlflowClient.post("/experiments/update", { experiment_id: params.experimentId, new_name: params.newName, }); } - src/tools/experiments.ts:108-111 (schema)Zod schema defining the input parameters for update-experiment: experimentId (string) and newName (string).
export const updateExperimentSchema = z.object({ experimentId: z.string().describe("Experiment ID"), newName: z.string().describe("New experiment name"), }); - src/index.ts:145-145 (registration)Registration of the update-experiment tool via the tool() helper, which registers it in the registry and conditionally adds it to the MCP server.
tool("update-experiment", "Rename an experiment", updateExperimentSchema.shape, wrapToolHandler(updateExperiment)); - src/tools/utils.ts:28-55 (helper)wrapToolHandler wraps the handler with error handling (redaction patterns for MLflow basic auth, structured error extraction for MlflowError and WriteBlockedError).
export const wrapToolHandler = createWrapToolHandler({ // Defaults already cover api_key, authorization, bearer, password, secret, token. // Basic auth header values are MLflow-specific and not in the default set. redactionPatterns: [/basic\s+\S+/i], errorExtractors: [ { match: (error) => error instanceof WriteBlockedError, extract: (error) => ({ kind: "passthrough", text: (error as WriteBlockedError).message, }), }, { match: (error) => error instanceof MlflowError, extract: (error) => { const err = error as MlflowError; return { kind: "structured", data: { message: err.message, status: err.status, body: err.body, }, }; }, }, ], }); - src/tools/utils.ts:14-17 (helper)assertWriteAllowed() is called by the handler to enforce read-only mode if MLFLOW_ALLOW_WRITE is not set.
export function assertWriteAllowed(): void { if (!config.allowWrite) { throw new WriteBlockedError(); }