Skip to main content
Glama

Add Database Row

add_database_row

Add a row to an AFFiNE database block by mapping cell values to column names or IDs. Select options are auto-created by label, and title text is stored on the row paragraph.

Instructions

Add a row to an AFFiNE database block. Provide cell values mapped by column name or column ID. Title column text is stored on the row paragraph block. Select columns auto-create options by label.

Input Schema

NameRequiredDescriptionDefault
cellsYesMap of column name (or column ID) to cell value. Rich-text and title values accept strings or delta arrays. For LinkedPage references, use insert: " " with reference.type="LinkedPage" and the target pageId; visible labels are resolved by AFFiNE. For select columns, pass the display label (option auto-created if new).
docIdYesDocument ID containing the database
linkedDocIdNoLink this row to an existing doc by ID. The row will open the linked doc in center peek when clicked.
workspaceIdNoWorkspace ID (optional if default set)
databaseBlockIdYesBlock ID of the affine:database block
expectedRevisionNoOptional read_doc revision of this primary document. Reject stale content before writing. Covers document content, not workspace metadata; requires all writers to share one MCP server.

Output Schema

NameRequiredDescriptionDefault
okNo
codeNo
addedNo
errorNo
detailsNo
causeCodeNo
cellCountNo
retryableNo
rowBlockIdNo
linkedDocIdNo
databaseBlockIdNo
recoveryGuidanceNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv3.10.2

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare non-read-only, non-idempotent, non-destructive and open-world. The description adds real context beyond them: title column text is stored on the row paragraph block as a side effect, and select columns auto-create missing options by label. It does not mention the stale-revision rejection path even though expectedRevision exists, so it is not a 5.

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?

Four short sentences with no filler, and the core action leads. Each sentence carries a distinct fact: purpose, cell mapping, title storage location, select option behavior. Nothing is repeated and nothing is buried.

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?

An output schema is present, so return values need no explanation. The description covers purpose, cell shape, and the two non-obvious write side effects (title paragraph block, auto-created select options) for a 6-parameter mutation tool with a nested object. Nothing an agent needs in order to call it correctly is missing.

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%, and the schema's cells description already covers delta arrays, LinkedPage references and select labels in more detail than the description's one-line summary. The description's 'mapped by column name or column ID' adds no meaning beyond the schema, so baseline 3 applies.

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: 'Add a row to an AFFiNE database block.' That is unambiguous and distinguishes it from update_database_row and delete_database_row by verb alone. It does not name those siblings explicitly, which keeps it just short of a 5.

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

Usage Guidelines3/5

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

Usage is only implied: the description instructs how to supply cell values, which suggests this is the tool for populating a database block. It never states when to use add_database_row versus update_database_row, nor any prerequisites such as whether the database block must already exist. Adequate but with a clear gap.

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

Deploy Server

Other Tools