create_asset

package
v0.0.34 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 21, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package create_asset implements the create_asset MCP tool: a single smart write tool for creating any Collibra asset. The agent supplies human-friendly identifiers (UUIDs, publicIds, or display names) for asset type, domain, status, and attributes; the server resolves them against Collibra's scoped assignment, gates a duplicate-name check (default-on), converts Markdown to HTML for RICH_TEXT attribute values, and writes the asset and its attributes.

create_asset replaces the four-tool flow (prepare_add_business_term, add_business_term, prepare_create_asset, create_asset) with one edit_asset-style entry point. Calling prepare_create_asset first is optional — useful only for discovery — because every resolution and validation step lives here too.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTool

func NewTool(collibraClient *http.Client) *chip.Tool[Input, Output]

NewTool returns the registered tool.

Types

type AssetSummary added in v0.0.33

type AssetSummary struct {
	ID          string `json:"id" jsonschema:"UUID of the newly created asset."`
	Name        string `json:"name"`
	DisplayName string `json:"displayName,omitempty"`
	Type        string `json:"type"`
	Domain      string `json:"domain"`
	Status      string `json:"status,omitempty"`
}

AssetSummary is the post-create snapshot of the asset.

type AttributeResult added in v0.0.33

type AttributeResult struct {
	Name            string `json:"name,omitempty" jsonschema:"Resolved attribute type display name."`
	TypeID          string `json:"typeId" jsonschema:"Resolved attribute type UUID."`
	Status          string `json:"status" jsonschema:"'success' or 'error'."`
	Error           string `json:"error,omitempty" jsonschema:"Error message when status is 'error'."`
	WrittenValue    string `` /* 214-byte string literal not displayed */
	ConvertedFromMd bool   `` /* 126-byte string literal not displayed */
}

AttributeResult is the outcome of one attribute write.

type DuplicateInfo added in v0.0.33

type DuplicateInfo struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

DuplicateInfo is one existing-asset reference returned in a duplicate_found response.

type Input

type Input struct {
	Name                        string           `json:"name" jsonschema:"Required. Name of the new asset."`
	AssetType                   string           `` /* 198-byte string literal not displayed */
	Domain                      string           `` /* 137-byte string literal not displayed */
	DisplayName                 string           `json:"displayName,omitempty" jsonschema:"Optional. Separate display name. Defaults to name when omitted."`
	Status                      string           `` /* 182-byte string literal not displayed */
	ExcludeFromAutoHyperlinking bool             `` /* 169-byte string literal not displayed */
	Attributes                  []InputAttribute `` /* 198-byte string literal not displayed */
	AllowDuplicate              bool             `` /* 268-byte string literal not displayed */
}

Input is the tool's typed input.

type InputAttribute added in v0.0.33

type InputAttribute struct {
	Name   string `` /* 199-byte string literal not displayed */
	TypeID string `json:"typeId,omitempty" jsonschema:"Attribute type UUID. Pass either name or typeId. typeId wins when both are supplied."`
	Value  string `` /* 204-byte string literal not displayed */
}

InputAttribute is one attribute slot the agent wants to set.

type Output

type Output struct {
	Status           OutputStatus      `` /* 218-byte string literal not displayed */
	Message          string            `json:"message" jsonschema:"Human-readable summary, including suggestions when validation fails."`
	Asset            *AssetSummary     `json:"asset,omitempty" jsonschema:"The newly created asset, on success."`
	Duplicates       []DuplicateInfo   `json:"duplicates,omitempty" jsonschema:"Existing assets that would conflict, on duplicate_found."`
	AttributeResults []AttributeResult `json:"attributeResults,omitempty" jsonschema:"Per-attribute outcomes, in the same order as input.attributes."`
}

Output is the typed response.

type OutputStatus added in v0.0.33

type OutputStatus string

OutputStatus is the overall outcome of a create_asset call.

const (
	// StatusSuccess means the asset was created. attributeResults reports
	// per-attribute outcomes, which may include individual errors that
	// did not block asset creation itself.
	StatusSuccess OutputStatus = "success"
	// StatusDuplicateFound means an existing asset with the same name in
	// the resolved (assetType, domain) was found and allowDuplicate was
	// false — no write occurred. The agent can re-call with
	// allowDuplicate=true after confirming with the user.
	StatusDuplicateFound OutputStatus = "duplicate_found"
	// StatusValidationError means resolution or validation failed before
	// any write — invalid asset type/domain, type not allowed in domain,
	// unknown attribute, etc. The message includes suggestions.
	StatusValidationError OutputStatus = "validation_error"
	// StatusError means the asset itself could not be created due to a
	// downstream Collibra error.
	StatusError OutputStatus = "error"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL