Skip to main content
Glama

upsert_attribute

Create a new attribute or update an existing one in an ERD, setting primary key, auto-increment, data type, nullability, uniqueness, or default value. Domain can dictate data type.

Instructions

Creates an attribute (no attributeId, logicalName required) or updates one (attributeId given, only provided fields change). primaryKey=true forces nullable=false and propagates child FKs. With a domain, the domain decides the data type. autoIncrement marks the column as identity — exported as AUTO_INCREMENT (mysql/cubrid/h2), IDENTITY(1,1) (sqlserver), or GENERATED BY DEFAULT AS IDENTITY (postgres/oracle); it applies to primary keys only.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
domainNo
sourceYesTarget ERD — exactly one of a local file ({file}) or a server ERD ({erdId})
uniqueNo
dataTypeNo
entityIdYes
nullableNo
primaryKeyNo
attributeIdNo
logicalNameNo
defaultValueNoRaw SQL default, emitted verbatim after DEFAULT — quote it yourself for string/date literals: "'N'" not "N". Unquoted values are treated as SQL expressions (`0`, `CURRENT_TIMESTAMP`), so a bare word becomes an identifier reference and produces invalid DDL.
autoIncrementNo
Behavior5/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It reveals critical side effects: primaryKey=true forces nullable=false and propagates child FKs; a domain decides the data type; autoIncrement has dialect-specific SQL export and applies only to primary keys. This far exceeds minimal expectations.

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, each dense with distinct information: create vs update semantics, primaryKey constraints, domain precedence, and autoIncrement dialect behavior. No filler or repetition, and the most important distinction is front-loaded.

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?

Given 11 parameters, no annotations, and no output schema, the description provides the most critical behavioral nuances. It could mention what happens if validation fails or what the tool returns, but it covers the core usage and side effects sufficiently for an agent to select and invoke 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 description coverage is only 18%, so the description must compensate. It adds meaning to attributeId, logicalName, primaryKey, domain, and autoIncrement, explaining their roles and interactions. However, it leaves unique, dataType edge cases, and defaultValue handling (beyond the schema's note) implicit, so it is not fully comprehensive.

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?

The description clearly states a dual create/update mode for attributes, specifying that creation requires no attributeId and logicalName, while updates use attributeId and only modify provided fields. This distinguishes it from sibling upsert tools (entity, relationship, domain) by focusing on attribute-specific behavior.

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?

The description gives explicit conditions for when to use the create path vs the update path based on the presence of attributeId. It also notes key behavioral triggers like primaryKey=true and domain overriding dataType. It does not explicitly name alternative tools, but the sibling names and the tool's attribute-specific scope make selection obvious.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/sqemo/sqemo-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server