Skip to main content
Glama

database_edge_upsert

Writes a labelled link between two rows of any tables, for relationships that are not a column: "duplicate of", "mentions", "replaces". Upserting an edge that already exists updates its properties, and upserting a proposed edge with status active approves it. Both rows must exist and be visible to the Product's role. Relationships must be on.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "productId": "<productId>",
      "databaseId": "<databaseId>",
      "from": "<from>",
      "to": "<to>",
      "label": "<label>"
    },
    "name": "database_edge_upsert"
  }
}

Input Schema

NameRequiredDescriptionDefault
toYes
fromYes
labelYes
propsNoAnything worth keeping on the link.
statusNoactive
confirmNoRequired for destructive operations. Without it a destructive call returns its plan and refuses, exactly as dry_run would.
dry_runNoReturn the plan without applying it: the resources it would create, change or destroy, and an estimated monthly cost. Free, and has no side effects. Call this before any change you have not made before.
productIdYesProduct identifier, e.g. prd_7k2m9x4qw1nv8bz3ct6d.
databaseIdYesDatabase identifier, from product_get or database_get.
idempotency_keyNoReplaying the same key returns the original result instead of acting twice. Strongly recommended for anything that creates a resource or spends money.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.1/5.0
Behavior4/5

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

Annotations only declare the safety profile (readOnlyHint=false, destructiveHint=false, idempotentHint=false), and the description adds genuinely useful behavior: upserting an existing edge mutates its properties, and re-upserting a 'proposed' edge with status=active approves it. It also discloses prerequisites (row visibility under the Product's role, graph relationships enabled), though it is silent on error behavior when a row is missing or invisible. There is a mild tension with idempotentHint=false, since upsert semantics imply convergence on repeat, but the description makes no explicit idempotency claim, so this is not a contradiction.

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 tight sentences: purpose first, then the upsert/approval behavior, then the preconditions. Every clause carries information an agent needs before calling, with no restatement of the name or schema fields.

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 10-parameter mutation with nested from/to objects and no output schema, the description covers purpose, upsert semantics, and authorization/feature preconditions, while the schema handles dry_run, confirm, and idempotency guidance. It does not say what a successful call returns (edge identifier or properties) or what happens on failure, which is the remaining gap.

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 60%, so the schema already documents dry_run, confirm, idempotency_key, productId, and the table/pk fields. The description adds meaning the schema lacks for the two undocumented params: status ('proposed' vs. 'active' and the approval transition) and props ('upserting an edge that already exists updates its properties'). It does not explain from/to beyond the row-existence requirement, leaving it above baseline but not exhaustive.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb and resource: 'Writes a labelled link between two rows of any tables', and scopes it against ordinary column relationships with concrete examples ('duplicate of', 'mentions', 'replaces'). It does not name or differentiate itself from the obvious sibling database_edge_delete, so it falls just short of the top mark.

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?

It gives a clear usage condition — use this for relationships that are not a column — plus preconditions ('Both rows must exist and be visible to the Product's role. Relationships must be on.'). It stops short of naming an alternative tool or stating when not to use it, which would be needed for a 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.

Resources