create-ml-model
Create a new ML model in OpenMetadata by providing its name, service, and algorithm. Optionally add features, target, description, tags, and owners.
Instructions
Create a new ML model
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ML Model name | |
| service | Yes | FQN of the ML model service | |
| algorithm | Yes | Algorithm used by the ML model | |
| description | No | ML Model description in markdown | |
| displayName | No | Display name | |
| mlFeatures | No | ML features definitions | |
| target | No | Target column or value | |
| tags | No | Tags to apply | |
| owners | No | Owner references |
Implementation Reference
- src/tools/mlmodels.ts:66-69 (handler)Handler function for create-ml-model tool. Calls assertWriteAllowed() to verify write access, then POSTs the params to /mlmodels endpoint to create a new ML model.
export async function createMlModel(params: z.infer<typeof createMlModelSchema>) { assertWriteAllowed(); return omClient.post("/mlmodels", params); } - src/tools/mlmodels.ts:54-64 (schema)Zod schema for create-ml-model defining required fields (name, service, algorithm) and optional fields (description, displayName, mlFeatures, target, tags, owners).
export const createMlModelSchema = z.object({ name: z.string().describe("ML Model name"), service: z.string().describe("FQN of the ML model service"), algorithm: z.string().describe("Algorithm used by the ML model"), description: z.string().optional().describe("ML Model description in markdown"), displayName: z.string().optional().describe("Display name"), mlFeatures: z.array(z.record(z.string(), z.any())).optional().describe("ML features definitions"), target: z.string().optional().describe("Target column or value"), tags: z.array(z.record(z.string(), z.any())).optional().describe("Tags to apply"), owners: z.array(z.record(z.string(), z.any())).optional().describe("Owner references"), }); - src/index.ts:313-313 (registration)Registration of the create-ml-model tool on the MCP server, wired with the schema and handler. Category is 'ML Models' (currentCategory unset, inheriting from previous ML Models section).
tool("create-ml-model", "Create a new ML model", createMlModelSchema.shape, wrapToolHandler(createMlModel));