Skip to main content
Glama

Change attributes of your object

set_attributes
Destructive

Modify attributes of objects in a writable Mount & Blade II: Bannerlord module XML in place. Set or remove values via ref and optional nested path; validate schema after writing.

Instructions

Changes attributes of an object that lives in a writable module, editing the file in place. Use path to reach nested elements (mini XPath): ItemComponent/Weapon, skills/skill[@id='OneHanded'], Equipments/EquipmentRoster[1]/equipment[@slot='Item0']. For objects owned by other modules use xslt_patch.

Input Schema

NameRequiredDescriptionDefault
allNoApply to every element matched by path (default false = must match exactly one).
refYesObject: Item.x, NPCCharacter.x, … or bare id.
setNoAttributes to set, e.g. {"weight": "2.5", "value": "1200"}. Values are strings.
pathNoOptional path to nested element(s) inside the object.
moduleYesWritable module that defines the object.
removeNoAttribute names to remove.
validateNoRun XSD validation after writing (default true).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=false and destructiveHint=true, so safety is covered; the description adds the important detail that the edit happens in place on the file and is limited to writable modules. It stops short of explaining reversibility, failure/rollback behavior on validation failure, or interaction with edit_history/undo_edit.

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

Conciseness5/5

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

Three sentences, front-loaded with the core action and scope, then path syntax, then the alternative tool. The dense XPath examples earn their space by being directly actionable.

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

Completeness4/5

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

For a destructive in-place mutation with 7 fully documented parameters and no output schema, the description covers purpose, scoping, routing, and path semantics. The remaining gap is failure behavior (e.g., whether a failed XSD validation leaves the file modified).

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 baseline is 3, but the description goes beyond the schema's vague 'Optional path to nested element(s)' by supplying real mini-XPath syntax and three worked examples. It does not add anything for set/remove/all/validate beyond what the schema already documents.

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 (changes attributes of an object) and immediately bounds the scope to objects in a writable module, edited in place. This clearly separates it from xslt_patch, which the description names as the tool for objects owned by other modules.

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 an explicit routing rule: use this tool for objects in a writable module, and use xslt_patch for objects owned by other modules. It also demonstrates when the path parameter is needed (nested elements) with three concrete XPath examples.

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