feat: add edit_asset MCP tool#58
Merged
Merged
Conversation
MieszkoWasniowski
approved these changes
May 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎯 What does this PR do?
Adds the
edit_assetMCP tool — a single entry point for updating any Collibra asset via a typedoperationsarray.Eight operation types
update_attribute,add_attribute,remove_attributeupdate_property(whitelisted:name,displayName,statusId)add_relation,remove_relationadd_tagset_responsibilityServer-side niceties (no agent plumbing required)
"candidate"," Candidate ", and"CANDIDATE"all hit.attribute "Bogus" is not valid for asset type "Business Term" in this domain. Attributes available: Acronym, Definition, Note (and 4 more).so the model can self-correct in one step.status: partial_success).add_attribute,update_attribute,add_relation) are coalesced into Collibra's/bulkendpoints; single ops use the cheaper individual endpoints./rolesand/statusesare only fetched when the request actually contains an op that needs them.Design decisions worth flagging
set_responsibilityusesPOST /rest/2.0/responsibilities(incremental, per-row) instead of the ticket-referencedPUT /rest/2.0/assets/{id}/responsibilities(destructive replace-all). Avoids an upsert-merge step.add_relationassumes the edited asset is the relation's source (head). Reversed directions surface as a Collibra 4xx per-op error, which the agent can read and retry.attributeName(multiple instances of the same attribute type) returns a disambiguation error rather than performing a silent multi-write.Files
pkg/tools/edit_asset/{tool.go,operations.go,bulk.go,tool_test.go}— new packagepkg/clients/edit_asset_client.go— REST helpers + DTOspkg/tools/register.go— register the toolTests
40+ unit tests covering happy paths per op type, validation paths, partial success, bulk batching, name resolution (status/role/user), case-insensitive matching, suggestion-in-errors, and lazy-load checks. Test stub now strictly enforces real
Collibra wire formats so future field-name regressions fail loudly in CI.
✅ Checklist