Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ This Go-based MCP server acts as a bridge between AI applications and Collibra,
- [`create_data_quality_rule_template`](pkg/tools/create_dq_rule_template/) - Create a reusable rule template β€” a parameterized SQL pattern with a `{{column}}` placeholder β€” in the DQ template library. Requires `name`, `sql`, `dialect`, `dimensions` and `description` (the DQ API requires all five); `businessRuleLinks` accepts Business Rule asset names or UUIDs and resolves names before the write. Confirm checkpoint: `confirm=false` (default) previews the exact template without creating; `confirm=true` creates. Returns the created template with its assigned id. A duplicate name is reported rather than overwriting **Experimental** (`data-quality` feature flag)
- [`update_data_quality_rule_template`](pkg/tools/update_dq_rule_template/) - Partially update a rule template by `name` β€” supply only the fields to change and the rest keep their stored values (the tool reads the template and merges, since the DQ API's update is a full-replacement PUT). The change ALWAYS cascades to every rule deployed from the template; the API offers no way to update the definition alone, so there is no cascade switch. Confirm checkpoint: `confirm=false` (default) previews the merged template and the affected-rule count; `confirm=true` applies it. Returns per-deployment outcomes, reporting `partial` when some deployed rules were skipped **Experimental** (`data-quality` feature flag)
- [`delete_data_quality_rule_template`](pkg/tools/delete_dq_rule_template/) - Delete a rule template by `name`. `cascade=false` (default) refuses the delete while rules deployed from the template are live and reports how many; `cascade=true` deletes the template and those rules together. Confirm checkpoint: `confirm=false` (default) reports exactly what would be deleted; `confirm=true` deletes. Out-of-the-box (system) templates are read-only and rejected. A missing template is reported as an error even though the DQ API's delete is idempotent **Experimental** (`data-quality` feature flag)
- [`detach_data_quality_rule_from_template`](pkg/tools/detach_dq_rule_from_template/) - Soft-unlink one deployed rule from its template, making it standalone. Non-destructive: the rule, its configuration and all run history are preserved β€” only the link is cleared, so later cascading updates/deletes no longer reach it. Identified by `template_name` + `job_name` + `deployed_rule_name` (a deployment has no id). Confirm checkpoint: `confirm=false` (default) verifies the rule really is deployed from that template and previews; `confirm=true` detaches. One-way β€” there is no re-link. **Requires:** Data Quality > Deploy Templates. **Experimental** (`data-quality` feature flag)
- [`dq_cancel_job_run`](pkg/tools/cancel_dq_job_run/) - Cancel an IN-PROGRESS Collibra data-quality job run. Supply EITHER `jobRunId` OR `jobName` (not both). By `jobRunId`: looks up the run's state and refuses with a clear message if it is already in a terminal state (finished/failed/cancelled). By `jobName`: finds the job's cancellable (non-terminal) runs β€” if exactly one, cancels it; if several, returns them as candidates (`needs_input`) so you can pick one and re-call with its `jobRunId`. No confirm checkpoint β€” the terminal-state pre-check (by ID) and non-terminal search filter (by name) are the safety mechanism. Cancellation is irreversible and immediately queued on success. **Experimental** (`data-quality` feature flag)
- [`dq_delete_job`](pkg/tools/delete_dq_job/) - PERMANENTLY DELETE a Collibra data-quality job definition by `jobName`, along with ALL of its runs, rules, monitors and results. THIS CANNOT BE UNDONE. Safety checkpoint: `confirm=false` (default) is READ-ONLY β€” it looks the job up and returns a summary (job type, edge site, connection, schema/table, source query, schedule) so you can review it with the user; call again with the same `jobName` and `confirm=true` to actually delete. If a run is in progress the service may refuse the delete β€” cancel it first with `dq_cancel_job_run`. To delete a single run rather than the whole job, use `dq_delete_job_run`; to change a job's configuration instead of removing it, use `dq_update_job`. **Experimental** (`data-quality` feature flag)
- [`dq_delete_job_run`](pkg/tools/delete_dq_job_run/) - PERMANENTLY DELETE a COMPLETED Collibra data-quality job run and ALL of its per-run results (profile, scan, monitor, rule, and alert output). THIS CANNOT BE UNDONE. Supply EITHER `jobRunId` OR `jobName`. Safety checkpoint: `confirm=false` (default) is READ-ONLY β€” returns the run's details without deleting so you can review them with the user; call again with the same `jobRunId` and `confirm=true` to actually delete. A `jobName` NEVER deletes directly: it only resolves candidate runs for review. Only terminal runs can be deleted β€” use `dq_cancel_job_run` first to stop any in-progress run. **Experimental** (`data-quality` feature flag)
Expand Down Expand Up @@ -246,7 +247,7 @@ Some functionality ships behind an opt-in `experimental` flag. These features ar

- `context-specifications` β€” Context specification tools: `list_context_specifications`, `get_context_specification`, and the `contextSpecificationId` parameter on `get_asset_details`. These tools generate structured YAML context for assets using the Semantic Blueprint API.

- `data-quality` β€” Data quality job-run inspection and rule-template authoring. Read-only: `get_data_quality_job_run_profile` (per-column profiling statistics for a run) and `get_data_quality_job_run_monitors` (per-monitor results for a run), both taking a `run_id` from `dq_search_job_runs`. Write: `create_data_quality_rule_template`, `update_data_quality_rule_template` and `delete_data_quality_rule_template`, which manage reusable parameterized rule patterns in the template library, plus the read-only `list_data_quality_rule_template_deployments` for seeing what a template has been deployed to before changing it.
- `data-quality` β€” Data quality job-run inspection and rule-template authoring. Read-only: `get_data_quality_job_run_profile` (per-column profiling statistics for a run) and `get_data_quality_job_run_monitors` (per-monitor results for a run), both taking a `run_id` from `dq_search_job_runs`. Write: `create_data_quality_rule_template`, `update_data_quality_rule_template` and `delete_data_quality_rule_template`, which manage reusable parameterized rule patterns in the template library, plus `list_data_quality_rule_template_deployments` for seeing what a template has been deployed to before changing it, and `detach_data_quality_rule_from_template` for unlinking a single deployed rule so it stops receiving cascades.

- `skills` β€” Embedded skill catalog served via two additional tools, `list_collibra_skills` and `load_collibra_skill`. Skills are short Markdown guides that document multi-step Collibra workflows (discovery, lineage, asset create/edit, …) for the connecting LLM. See [SKILLS.md](SKILLS.md) for the catalog.

Expand Down
2 changes: 1 addition & 1 deletion cmd/chip/experimental.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
var knownExperimentalFeatures = map[string]string{
skills.FeatureName: "Embedded skill catalog served via list_collibra_skills and load_collibra_skill.",
tools.ContextSpecificationsFeature: "Context specification tools: list_context_specifications, get_context_specification, and contextSpecificationId parameter on get_asset_details.",
tools.DataQualityFeature: "Data quality job-run inspection (get_data_quality_job_run_profile, get_data_quality_job_run_monitors) and rule-template authoring (create/update/delete_data_quality_rule_template, list_data_quality_rule_template_deployments).",
tools.DataQualityFeature: "Data quality job-run inspection (get_data_quality_job_run_profile, get_data_quality_job_run_monitors) and rule-template authoring (create/update/delete_data_quality_rule_template, list_data_quality_rule_template_deployments, detach_data_quality_rule_from_template).",
}

// validateExperimental warns (without exiting) when the user enabled an
Expand Down
52 changes: 52 additions & 0 deletions pkg/clients/dq_template_write_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ var (
// ErrDQRuleTemplateReadOnly means the template is out-of-the-box
// (system-defined) and the API refuses to modify or delete it.
ErrDQRuleTemplateReadOnly = errors.New("rule template is out-of-the-box and cannot be modified")
// ErrDQRuleNotFound means the job has no rule under the given name. The
// detach endpoint answers 404 for this, distinctly from an unknown template.
ErrDQRuleNotFound = errors.New("rule not found on job")
// ErrDQRuleNotFromTemplate means the rule exists but is not currently linked
// to the given template β€” either it is already standalone, or it came from a
// different template. The API answers 400 and does not distinguish the two.
ErrDQRuleNotFromTemplate = errors.New("rule is not linked to this template")
)

// DQRuleTemplateWriteRequest is the create/update payload for a rule template
Expand Down Expand Up @@ -135,3 +142,48 @@ func DeleteDQRuleTemplate(ctx context.Context, client *http.Client, ruleTemplate
return fmt.Errorf("%s: unexpected status %d: %s", op, status, string(respBody))
}
}

// dqRuleDetachRequest is the detach payload (RuleTemplateDetachRequest). A
// deployment has no id of its own, so the rule is addressed by the job it runs
// on plus its deployed name.
type dqRuleDetachRequest struct {
JobName string `json:"jobName"`
DeployedRuleName string `json:"deployedRuleName"`
}

// DetachDQRuleFromTemplate soft-unlinks one deployed rule from its template β€”
// POST /rest/dq/1.0/ruleTemplates/{ruleTemplateName}/detach. The rule and all of
// its run history are preserved; only the link is cleared, so later cascades
// from the template no longer reach it. Answers 204 with no body on success.
//
// The 400 is deliberately mapped to a single sentinel: RuleTemplatesBll.detach
// raises the same RULE_NOT_FROM_TEMPLATE for a rule that is already standalone
// and for one that belongs to a different template, so the API gives callers no
// way to tell those apart.
func DetachDQRuleFromTemplate(ctx context.Context, client *http.Client, ruleTemplateName, jobName, deployedRuleName string) error {
path := "/rest/dq/1.0/ruleTemplates/" + url.PathEscape(ruleTemplateName) + "/detach"
respBody, status, err := dqDo(ctx, client, http.MethodPost, path, dqRuleDetachRequest{
JobName: jobName,
DeployedRuleName: deployedRuleName,
})
if err != nil {
return fmt.Errorf("detaching dq rule from template: %w", err)
}
switch status {
case http.StatusNoContent, http.StatusOK:
return nil
case http.StatusBadRequest:
return fmt.Errorf("detaching dq rule from template: %w: %q on job %q: %s",
ErrDQRuleNotFromTemplate, deployedRuleName, jobName, string(respBody))
case http.StatusNotFound:
// The endpoint answers 404 for both an unknown template and a rule that
// does not exist on the job; the body is the only discriminator, so the
// tool layer reports both possibilities rather than guessing.
return fmt.Errorf("detaching dq rule from template: %w: template %q or rule %q on job %q: %s",
ErrDQRuleNotFound, ruleTemplateName, deployedRuleName, jobName, string(respBody))
case http.StatusForbidden:
return fmt.Errorf("detaching dq rule from template: missing permission to manage template deployments: %s", string(respBody))
default:
return fmt.Errorf("detaching dq rule from template: unexpected status %d: %s", status, string(respBody))
}
}
Loading
Loading