update-database-service
Update a database service with JSON Patch operations by providing its UUID and a list of changes.
Instructions
Update a database service using JSON Patch
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Service UUID | |
| operations | Yes | JSON Patch operations |
Implementation Reference
- src/tools/services.ts:61-64 (handler)The handler function that executes the 'update-database-service' tool logic: validates write access, then sends a PATCH request to /services/databaseServices/{id} with JSON Patch operations.
export async function updateDatabaseService(params: z.infer<typeof updateDatabaseServiceSchema>) { assertWriteAllowed(); return omClient.patch(`/services/databaseServices/${params.id}`, params.operations); } - src/tools/services.ts:56-59 (schema)Zod schema defining input validation for 'update-database-service': requires an 'id' (string UUID) and 'operations' (array of JSON Patch operations).
export const updateDatabaseServiceSchema = z.object({ id: z.string().describe("Service UUID"), operations: z.array(z.record(z.string(), z.any())).describe("JSON Patch operations"), }); - src/index.ts:215-215 (registration)Registration of the 'update-database-service' tool in the MCP server, mapping the schema and handler.
tool("update-database-service", "Update a database service using JSON Patch", updateDatabaseServiceSchema.shape, wrapToolHandler(updateDatabaseService)); - src/tools/utils.ts:18-43 (helper)wrapToolHandler wraps the raw handler with error handling and redaction logic, created via createWrapToolHandler from @us-all/mcp-toolkit.
export const wrapToolHandler = createWrapToolHandler({ redactionPatterns: [/OPENMETADATA_TOKEN/i], errorExtractors: [ { match: (error) => error instanceof WriteBlockedError, extract: (error) => ({ kind: "passthrough", text: (error as WriteBlockedError).message, }), }, { match: (error) => error instanceof OpenMetadataError, extract: (error) => { const err = error as OpenMetadataError; return { kind: "structured", data: { message: err.message, status: err.status, details: err.body, }, }; }, }, ], }); - src/tools/utils.ts:12-16 (helper)assertWriteAllowed is called by the handler to ensure write operations are enabled in config.
export function assertWriteAllowed(): void { if (!config.allowWrite) { throw new WriteBlockedError(); } }