Skip to content

apply_resource_tags

Apply the exact previewed resource kind/ID, mode, tag selectors and preview_id once. Revalidate raw resource metadata/configuration and resolved tag definitions. Omission/unchanged/add-existing are zero-write no-ops; replace[] clears deliberately. Submit only target and exact stable tag IDs through typed UpdateResourceMeta, preserving description/template/configuration. Core requires Write. Report acknowledgement separately from exact tags/unrelated-metadata read-back; concurrent deletion can still make Core drop an ID. No execute, automatic retry or credential fallback.

Availability

KOMODO_ALLOW_CONFIGURATION_EDIT=true

The instance’s tool selection and upstream Core permissions also apply. Some inputs require additional grants.

Effect annotations

  • readOnlyHint — false
  • destructiveHint — false
  • idempotentHint — false

Inputs

The registered schema gives field types, alternatives and declared bounds. The description and operator guides also cover checks applied at runtime.

mode
default "replace" · Schema AssignmentMode
preview_id
Required · type "string"
tags
type "array" · default null
target
Required · Schema Target
Show input JSON Schema
{
  "type": "object",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "properties": {
    "mode": {
      "$ref": "#/$defs/AssignmentMode",
      "default": "replace"
    },
    "preview_id": {
      "type": "string"
    },
    "tags": {
      "default": null,
      "items": {
        "$ref": "#/$defs/DetailInput"
      },
      "type": "array"
    },
    "target": {
      "$ref": "#/$defs/Target"
    }
  },
  "required": [
    "target",
    "preview_id"
  ],
  "$defs": {
    "AssignmentMode": {
      "enum": [
        "replace",
        "add"
      ],
      "type": "string"
    },
    "DetailInput": {
      "additionalProperties": false,
      "oneOf": [
        {
          "required": [
            "id"
          ]
        },
        {
          "required": [
            "name"
          ]
        }
      ],
      "properties": {
        "id": {
          "description": "Exact stable resource ID returned by a list tool.",
          "pattern": "^[0-9a-fA-F]{24}$",
          "type": "string"
        },
        "name": {
          "description": "Exact, case-sensitive name within this family; never interpreted as an ID.",
          "minLength": 1,
          "pattern": "\\S",
          "type": "string"
        }
      },
      "type": "object"
    },
    "ResourceKind": {
      "enum": [
        "stack",
        "deployment",
        "server"
      ],
      "type": "string"
    },
    "Target": {
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "string"
        },
        "kind": {
          "$ref": "#/$defs/ResourceKind"
        }
      },
      "required": [
        "kind",
        "id"
      ],
      "type": "object"
    }
  }
}

Output

The registered output schema covers structured results and tool errors.

TagResult
after_tags, assignment_cleanup_fully_verified, before_tags, change_verified, coverage, effects, errors, evidence_gaps, observed_tags, operation, outcome, preview_id, resource, tag_after, tag_before, tag_record_observation, tag_removal_reported_by_core, visible_assignments, writes_submitted
AppError
candidates, correction, field, kind, message, operation, status
Show output JSON Schema
{
  "type": "object",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "anyOf": [
    {
      "$ref": "#/$defs/TagResult"
    },
    {
      "$ref": "#/$defs/AppError"
    }
  ],
  "$defs": {
    "AppError": {
      "additionalProperties": false,
      "description": "Only application-owned messages and selected, nonsensitive metadata survive.",
      "properties": {
        "candidates": {
          "items": {
            "$ref": "#/$defs/Candidate"
          },
          "type": [
            "array",
            "null"
          ]
        },
        "correction": {
          "type": [
            "string",
            "null"
          ]
        },
        "field": {
          "type": [
            "string",
            "null"
          ]
        },
        "kind": {
          "$ref": "#/$defs/ErrorKind"
        },
        "message": {
          "type": "string"
        },
        "operation": {
          "type": "string"
        },
        "status": {
          "format": "uint16",
          "maximum": 65535,
          "minimum": 0,
          "type": [
            "integer",
            "null"
          ]
        }
      },
      "required": [
        "kind",
        "message",
        "operation"
      ],
      "type": "object"
    },
    "AssignedTag": {
      "properties": {
        "color": {
          "type": [
            "string",
            "null"
          ]
        },
        "error": {
          "anyOf": [
            {
              "$ref": "#/$defs/AppError"
            },
            {
              "type": "null"
            }
          ]
        },
        "id": {
          "type": "string"
        },
        "name": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "id",
        "name",
        "color",
        "error"
      ],
      "type": "object"
    },
    "Assignment": {
      "properties": {
        "error": {
          "anyOf": [
            {
              "$ref": "#/$defs/AppError"
            },
            {
              "type": "null"
            }
          ]
        },
        "expected_effect": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "kind": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "observation": {
          "type": [
            "string",
            "null"
          ]
        },
        "tags_after": {
          "items": {
            "type": "string"
          },
          "type": [
            "array",
            "null"
          ]
        },
        "tags_before": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "template": {
          "type": "boolean"
        },
        "unrelated_tags_preserved": {
          "type": [
            "boolean",
            "null"
          ]
        }
      },
      "required": [
        "kind",
        "id",
        "name",
        "template",
        "tags_before",
        "expected_effect",
        "observation",
        "tags_after",
        "unrelated_tags_preserved",
        "error"
      ],
      "type": "object"
    },
    "Candidate": {
      "additionalProperties": false,
      "description": "A bounded ambiguity hint, never a raw upstream resource.",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "name"
      ],
      "type": "object"
    },
    "Coverage": {
      "properties": {
        "error": {
          "anyOf": [
            {
              "$ref": "#/$defs/AppError"
            },
            {
              "type": "null"
            }
          ]
        },
        "family": {
          "type": "string"
        },
        "hidden_records_possible": {
          "type": "boolean"
        },
        "visible_records_examined": {
          "format": "uint",
          "minimum": 0,
          "type": "integer"
        },
        "visible_scan_complete": {
          "type": "boolean"
        }
      },
      "required": [
        "family",
        "visible_records_examined",
        "visible_scan_complete",
        "hidden_records_possible",
        "error"
      ],
      "type": "object"
    },
    "ErrorKind": {
      "description": "Stable public categories. No variant contains a raw upstream error.",
      "enum": [
        "invalid_arguments",
        "not_found",
        "ambiguous_target",
        "incomplete_resolution",
        "configuration",
        "authentication",
        "permission_denied",
        "timeout",
        "unreachable",
        "upstream",
        "invalid_response",
        "response_too_large",
        "capability_disabled",
        "unsupported_target",
        "stale_preview",
        "invalid_preview"
      ],
      "type": "string"
    },
    "Outcome": {
      "enum": [
        "preview",
        "no_op",
        "acknowledged",
        "submission_unknown"
      ],
      "type": "string"
    },
    "ResourceKind": {
      "enum": [
        "stack",
        "deployment",
        "server"
      ],
      "type": "string"
    },
    "ResourceView": {
      "properties": {
        "id": {
          "type": "string"
        },
        "kind": {
          "$ref": "#/$defs/ResourceKind"
        },
        "name": {
          "type": "string"
        }
      },
      "required": [
        "kind",
        "id",
        "name"
      ],
      "type": "object"
    },
    "TagResult": {
      "properties": {
        "after_tags": {
          "items": {
            "$ref": "#/$defs/AssignedTag"
          },
          "type": "array"
        },
        "assignment_cleanup_fully_verified": {
          "type": "boolean"
        },
        "before_tags": {
          "items": {
            "$ref": "#/$defs/AssignedTag"
          },
          "type": "array"
        },
        "change_verified": {
          "type": "boolean"
        },
        "coverage": {
          "items": {
            "$ref": "#/$defs/Coverage"
          },
          "type": "array"
        },
        "effects": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "errors": {
          "items": {
            "$ref": "#/$defs/AppError"
          },
          "type": "array"
        },
        "evidence_gaps": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "observed_tags": {
          "items": {
            "$ref": "#/$defs/AssignedTag"
          },
          "type": [
            "array",
            "null"
          ]
        },
        "operation": {
          "type": "string"
        },
        "outcome": {
          "$ref": "#/$defs/Outcome"
        },
        "preview_id": {
          "type": [
            "string",
            "null"
          ]
        },
        "resource": {
          "anyOf": [
            {
              "$ref": "#/$defs/ResourceView"
            },
            {
              "type": "null"
            }
          ]
        },
        "tag_after": {
          "anyOf": [
            {
              "$ref": "#/$defs/TagView"
            },
            {
              "type": "null"
            }
          ]
        },
        "tag_before": {
          "anyOf": [
            {
              "$ref": "#/$defs/TagView"
            },
            {
              "type": "null"
            }
          ]
        },
        "tag_record_observation": {
          "type": [
            "string",
            "null"
          ]
        },
        "tag_removal_reported_by_core": {
          "type": "boolean"
        },
        "visible_assignments": {
          "items": {
            "$ref": "#/$defs/Assignment"
          },
          "type": "array"
        },
        "writes_submitted": {
          "format": "uint8",
          "maximum": 255,
          "minimum": 0,
          "type": "integer"
        }
      },
      "required": [
        "operation",
        "outcome",
        "preview_id",
        "writes_submitted",
        "change_verified",
        "tag_before",
        "tag_after",
        "resource",
        "before_tags",
        "after_tags",
        "observed_tags",
        "tag_record_observation",
        "tag_removal_reported_by_core",
        "visible_assignments",
        "coverage",
        "assignment_cleanup_fully_verified",
        "effects",
        "evidence_gaps",
        "errors"
      ],
      "type": "object"
    },
    "TagView": {
      "properties": {
        "color": {
          "type": "string"
        },
        "id": {
          "type": [
            "string",
            "null"
          ]
        },
        "name": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "name",
        "color"
      ],
      "type": "object"
    }
  }
}

Operator guides

All built-in tools