Skip to main content
Glama

Upsert Row

upsert_row

Create a row in a v2 app's collection, or return the existing row when key is already present (deduped:true). Row creation goes through this tool; there is no separate strict-create verb. Omit key to add a new row with a server-generated key, or pass key to ensure a row exists at that key. Passing key is also what makes a retry safe: a call unsure whether it already landed can repeat it and get the same row back rather than a duplicate. Without key, a retry mints a second row with its own server-generated key, since there is nothing to dedup against. The collection must be declared in the app's manifest with 'agent' in its write list, which is the list that gates creates. When key matches a row the collection's read list does not reach for this caller, the result is row_not_found rather than the row, matching what get_row would return, so this never reads past read. Returns { row, deduped? }.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyNoOptional stable key. Reusing an existing key returns the existing row (deduped:true), or row_not_found when the collection's read list does not reach that row for the caller.
dataYesThe row body - any JSON value valid against the collection's row schema (an object, or any JSON value for a schemaless collection).
app_idYesThe app id.
collectionYesThe collection name.

TDQS

A4.7/5.0
Behavior5/5

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

Even though annotations already mark readOnly=false and destructive=false, the description goes far beyond them. It discloses dedupe behavior, retry safety, the duplicate-row risk when `key` is omitted, the manifest `write` list requirement, the `row_not_found` behavior when the `read` list does not reach the row, and the return shape `{ row, deduped? }`. This is exemplary behavioral transparency.

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 long but dense and well-structured. It front-loads the core purpose, then logically explains key semantics, retry behavior, permission requirements, and return shape. Every sentence contributes necessary behavioral or usage context without padding.

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?

Given the tool's complexity and the absence of an output schema, the description is exceptionally complete. It covers prerequisites (manifest write list), edge cases (dedupe, retry, read-list limitations), and the return format. There are no significant gaps in what an agent needs to know to invoke this tool 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?

The input schema already covers all four parameters with descriptions (100% coverage), so the baseline is 3. The description adds meaningful semantic detail beyond the schema, especially for `key`: omitting it creates a new row, passing it enables dedupe and retry safety. It also clarifies the `data` parameter as 'any JSON value valid against the collection's row schema'. This elevated value justifies a 4.

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 begins with a specific verb+resource: 'Create a row in a v2 app's collection, or return the existing row when `key` is already present' – clearly stating its upsert behavior. It distinguishes itself from sibling tools like get_row, update_row, and delete_row by emphasizing the create-or-return semantics and deduplication.

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 clear context for when to use this tool: 'Row creation goes through this tool; there is no separate strict-create verb.' It also explains the key distinction between omitting `key` (new row with server-generated key) and passing `key` (dedupe/retry safety), which guides usage. It does not explicitly contrast with update_row or list other exclusions, so it stops short of a perfect 5.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

TDQS

A4.1/5.0
Disambiguation4/5

Most tools are clearly distinct, with row operations (list, get, upsert, update, delete, restore) well separated. Some boundaries like apps vs deploy_app and credentials vs grants require careful reading, but descriptions resolve the overlap.

Naming Consistency2/5

Tool names mix resource nouns (apps, attachments, connections) with verb_noun actions (delete_row, deploy_app). Singular and plural forms are inconsistent, and there is no uniform pattern across the set.

Tool Count3/5

24 tools is on the heavy side, but the platform's breadth (app deployment, data, auth, community) justifies the count. Each tool has a distinct role, though the set slightly exceeds the typical well-scoped range.

Completeness4/5

The surface covers the full app lifecycle: deploy, manage, delete, row CRUD with restore, attachments, credentials, and community features. Minor gaps like no dedicated row search or outbound webhook management are workable via existing tools.