Skip to main content
Glama

add_mass_trait

Idempotent

Attach a Mass entity trait to a UMassEntityConfigAsset and save the config, skipping duplicates. Use it to assemble entity configs without redundant traits.

Instructions

Adds a trait (a concrete UMassEntityTraitBase subclass) to a UMassEntityConfigAsset and saves the config. Idempotent: if the config already holds a trait of exactly that class, itself or through its parent config chain, nothing is added or saved and the reply has added=false, already_existed=true and that trait's trait_path. trait_class takes a reflected name with or without its U prefix, or a /Script path; an unknown or non-trait class is an error, but an abstract one is not refused: the engine creates it behind an ensure and warns it is nulled out on save. Edit it with set_mass_trait_property; remove_mass_trait is the inverse; add_mass_trait_to_entity tags a live entity instead.

Returns: { config_path, trait_class, trait_path, trait_count, added, already_existed, saved }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
config_pathYesAsset path to the UMassEntityConfig
trait_classYesTrait class name to add (e.g. UMassMovementTrait)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

A4.8/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations declare readOnly=false, idempotent=true, destructive=false, but the description goes well past them: it defines exactly what idempotency means (checks the parent config chain, adds nothing and returns added=false/already_existed=true), explains the save side effect, and discloses the abstract-class edge case where the engine creates it behind an ensure and warns it is nulled on save.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the core action and idempotency behavior, and every sentence carries information. It is dense and slightly run-on, with the abstract-class tangent adding length, but nothing is filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite having no output schema, the description spells out the full return shape (config_path, trait_class, trait_path, trait_count, added, already_existed, saved). Combined with the error and side-effect disclosure, an agent has everything needed to call it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds real semantics the schema lacks: trait_class accepts a reflected name with or without the U prefix or a /Script path, and an unknown or non-trait class is an error. config_path gets no elaboration, but it is self-evident from its schema description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Adds a trait ... to a UMassEntityConfigAsset and saves the config') and names the exact class family (UMassEntityTraitBase subclass). It explicitly distinguishes itself from the three nearest siblings (set_mass_trait_property, remove_mass_trait, add_mass_trait_to_entity), so an agent can route without opening any schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives explicit alternatives and their selecting conditions: edit the added trait with set_mass_trait_property, the inverse is remove_mass_trait, and add_mass_trait_to_entity is for live entities rather than config assets. This is when-to-use/when-not guidance with named alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools