Documentation
¶
Overview ¶
Package prepare_create_asset implements the prepare_create_asset MCP tool — a read-only companion to create_asset. It lists available asset types and domains, resolves a name/publicId/UUID for either, and hydrates the scoped attribute and relation schema for a chosen (assetType, domain) pair so the agent knows what fields and statuses are available before composing the create. It does NOT perform duplicate detection or pre-flight validation — those live in create_asset itself, which is fully self-sufficient. Use this tool only when the agent needs to enumerate options or inspect a type's full schema.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AssetTypeOption ¶
type AssetTypeOption struct {
ID string `json:"id" jsonschema:"UUID of the asset type."`
PublicID string `json:"publicId" jsonschema:"PublicId of the asset type."`
Name string `json:"name" jsonschema:"Display name of the asset type."`
}
AssetTypeOption is one entry in assetTypeOptions.
type AttributeSchemaEntry ¶ added in v0.0.33
type AttributeSchemaEntry struct {
AttributeTypeID string `json:"attributeTypeId" jsonschema:"UUID of the attribute type — pass this in attributes[].typeId to create_asset."`
Name string `json:"name" jsonschema:"Display name of the attribute (e.g. 'Definition', 'Note'). Also accepted by create_asset."`
PublicID string `json:"publicId,omitempty" jsonschema:"PublicId of the attribute type."`
Kind string `json:"kind" jsonschema:"Attribute-type discriminator (e.g. 'StringAttributeType', 'NumericAttributeType')."`
Required bool `` /* 296-byte string literal not displayed */
Min int `json:"min" jsonschema:"Minimum number of occurrences."`
Max *int `json:"max,omitempty" jsonschema:"Maximum number of occurrences. Absent when unbounded."`
StringType string `` /* 207-byte string literal not displayed */
Description string `` /* 139-byte string literal not displayed */
AllowedValues []string `` /* 139-byte string literal not displayed */
}
AttributeSchemaEntry is one attribute slot in the scoped assignment.
type DomainOption ¶
type DomainOption struct {
ID string `json:"id" jsonschema:"UUID of the domain."`
Name string `json:"name" jsonschema:"Display name of the domain."`
TypeName string `json:"typeName,omitempty" jsonschema:"Display name of the domain's domain type, when included by the API."`
}
DomainOption is one entry in domainOptions.
type Input ¶
type Input struct {
AssetType string `` /* 263-byte string literal not displayed */
Domain string `` /* 169-byte string literal not displayed */
IncludeStringType bool `` /* 283-byte string literal not displayed */
}
Input is the tool's typed input. Either assetType or domain may be omitted to enumerate options.
type Output ¶
type Output struct {
Status Status `` /* 234-byte string literal not displayed */
Message string `json:"message" jsonschema:"Human-readable summary of the outcome."`
Resolved *Resolved `` /* 182-byte string literal not displayed */
AssetTypeOptions []AssetTypeOption `` /* 201-byte string literal not displayed */
DomainOptions []DomainOption `` /* 138-byte string literal not displayed */
OptionsTruncated bool `json:"optionsTruncated" jsonschema:"Whether assetTypeOptions or domainOptions was truncated below the instance's true total."`
AttributeSchema []AttributeSchemaEntry `` /* 278-byte string literal not displayed */
RelationTypes []RelationSchemaEntry `` /* 241-byte string literal not displayed */
AvailableStatuses []StatusOption `` /* 219-byte string literal not displayed */
}
Output is the structured discovery response.
type RelationLegEntry ¶ added in v0.0.43
type RelationLegEntry struct {
Role string `json:"role" jsonschema:"Role name of this leg (e.g. 'source', 'target', 'constrains')."`
CoRole string `json:"coRole,omitempty" jsonschema:"Reverse role name of this leg."`
AssetTypeID string `json:"assetTypeId,omitempty" jsonschema:"UUID of the asset type on this leg."`
AssetTypeName string `json:"assetTypeName,omitempty" jsonschema:"Display name of the asset type on this leg."`
RelationTypePublicID string `json:"relationTypePublicId,omitempty" jsonschema:"PublicId of the simple relation type underlying this leg."`
Min int `json:"min" jsonschema:"Minimum number of occurrences for this leg."`
Max *int `json:"max,omitempty" jsonschema:"Maximum number of occurrences for this leg. Absent when unbounded."`
}
RelationLegEntry is one leg of a complex relation type.
type RelationSchemaEntry ¶ added in v0.0.33
type RelationSchemaEntry struct {
RelationTypeID string `` /* 211-byte string literal not displayed */
PublicID string `json:"publicId,omitempty" jsonschema:"PublicId of the relation type."`
Kind string `` /* 204-byte string literal not displayed */
Role string `` /* 136-byte string literal not displayed */
CoRole string `json:"coRole,omitempty" jsonschema:"Reverse role name (e.g. 'contains')."`
Direction string `` /* 184-byte string literal not displayed */
TargetTypeID string `` /* 180-byte string literal not displayed */
TargetTypeName string `json:"targetTypeName,omitempty" jsonschema:"Display name of the asset type on the other leg, when restricted."`
// Legs is populated only for complex relation types (Kind ==
// "ComplexRelationType"), one entry per leg.
Legs []RelationLegEntry `` /* 157-byte string literal not displayed */
}
RelationSchemaEntry is one relation slot in the scoped assignment.
type Resolved ¶ added in v0.0.33
type Resolved struct {
AssetTypeID string `json:"assetTypeId" jsonschema:"UUID of the resolved asset type."`
AssetTypeName string `json:"assetTypeName" jsonschema:"Display name of the resolved asset type."`
AssetTypePublicID string `json:"assetTypePublicId,omitempty" jsonschema:"PublicId of the resolved asset type, when known."`
DomainID string `json:"domainId" jsonschema:"UUID of the resolved domain."`
DomainName string `json:"domainName" jsonschema:"Display name of the resolved domain."`
DomainTypeID string `` /* 142-byte string literal not displayed */
DomainTypeName string `json:"domainTypeName,omitempty" jsonschema:"Display name of the resolved domain's domain type."`
}
Resolved holds the fully-resolved IDs for an assetType + domain pair.
type Status ¶ added in v0.0.33
type Status string
Status is the discovery outcome.
const ( // StatusReady means an assetType + domain were both resolved and the // scoped assignment was hydrated successfully — the agent has // everything it needs to call create_asset. StatusReady Status = "ready" // StatusIncomplete means at least one of assetType / domain was // missing; the response includes pre-fetched options. StatusIncomplete Status = "incomplete" // StatusNeedsClarification means resolution failed (typo, multiple // matches, asset type not allowed in domain). Options for recovery // are included where useful. StatusNeedsClarification Status = "needs_clarification" )
type StatusOption ¶ added in v0.0.33
type StatusOption struct {
ID string `json:"id" jsonschema:"UUID of the status."`
Name string `json:"name" jsonschema:"Display name of the status."`
}
StatusOption is one entry in availableStatuses.