Skip to main content
Glama

attributes_add_field

Add a new field to an editable vector layer by specifying name, type (integer, double, string, date, datetime, boolean), and optionally length and precision for string or double fields.

Instructions

Add a new field to a vector layer.

type is one of: integer, double, string, date, datetime, boolean. length/precision only matter for string/double fields. Requires an editable data source - fails with an EditFailed error on read-only layers.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
typeYes
lengthNo
layer_idYes
precisionNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses the EditFailed error for read-only layers but does not mention other behaviors like duplicate name handling, atomicity, or side effects on existing fields. Some behavioral context is provided via the type enum and length/precision notes.

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?

The description is concise (three sentences) and front-loaded with the core purpose. Every sentence adds essential information without redundancy.

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 that an output schema exists (though not provided), the description does not need to detail return values. It covers the core action, key parameter details, and a critical error condition. However, it lacks information about whether field names must be unique or if there are any limits.

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?

With 0% schema description coverage, the description adds significant value by explaining the 'type' parameter as an enum of specific types and noting that 'length' and 'precision' matter only for string/double fields. This goes beyond the schema which only defines them as strings/integers.

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 'Add a new field to a vector layer,' specifying the verb (Add) and resource (field to vector layer). It distinguishes from sibling tools like attributes_delete_field and attributes_rename_field by focusing on addition.

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 provides an explicit prerequisite: 'Requires an editable data source - fails with an EditFailed error on read-only layers.' This tells when to use (editable layers) and when not to. However, it does not compare to other field-related tools like attributes_calculate or attributes_update_feature.

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/piatkowski/qgis-mcp'

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