Skip to main content
Glama
ianderso
by ianderso

add_attribute

Attach a typed key/value attribute, like Occupation or Identification Number, to a Gramps person, event, family, media, source, or citation. Use it to record details such as Blacksmith.

Instructions

Add a typed key/value attribute to an object. update_attribute changes or removes one already there.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesAttribute type/name, e.g. 'Occupation', 'Identification Number', or a custom name the tree already has.
valueYesAttribute value, e.g. 'Blacksmith'.
targetYesHandle or gramps_id of the object.
object_typeYesType of the object: 'person', 'event', 'family', 'media', 'source', 'citation'.
allow_new_typeNoAccept a type that is neither a Gramps standard type nor one of the tree's custom types, creating it as a new custom type. Only when meant: a near-miss is refused with the closest names.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv1.2.0
    • addedInput schema / properties / allow_new_type
      Added value: +{
      +  "default": false,
      +  "description": "Accept a type that is neither a Gramps standard type nor one of the tree's custom types, creating it as a new custom type. Only when meant: a near-miss is refused with the closest names.",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / name / description
      Previous value: -"Attribute type/name, e.g. 'Occupation', 'National ID'."New value: +"Attribute type/name, e.g. 'Occupation', 'Identification Number', or a custom name the tree already has."
  2. First observedv0.1.0

TDQS

A4/5.0
Behavior3/5

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

Annotations already declare the full safety profile (readOnly=false, destructive=false, idempotent=false), so much of the disclosure burden is lifted. The description adds only the 'typed key/value' framing and no information on duplicate names, permissions, or failure behavior beyond what annotations and the allow_new_type schema field provide.

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?

Two short sentences, front-loaded with the action and followed immediately by the disambiguating contrast. Every clause earns its place; nothing is repeated from the schema.

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 non-destructive mutation with full annotation coverage, 100% schema coverage, and no output schema, the definition is nearly sufficient. It could note what happens when an attribute name already exists on the target, but the essential call information is present.

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

Parameters3/5

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

Schema description coverage is 100%, so all five parameters including allow_new_type are already documented in the schema, including the near-miss refusal behavior. The description's 'typed' phrasing adds no syntax or format detail beyond what the schema states, so the baseline of 3 applies.

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 ('Add a typed key/value attribute to an object'), and immediately contrasts with update_attribute, which is the closest sibling in the catalog. An agent can distinguish add vs. modify/remove without opening either schema.

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

Usage Guidelines4/5

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

Explicitly names the alternative tool (update_attribute) and the condition that selects it ('changes or removes one already there'), which is exactly the when-not guidance an agent needs. It does not cover the add_url/add_note siblings, but the primary routing decision is resolved.

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