Skip to main content
Glama

Delete Surface Element

delete_surface_element
Destructive

Delete a surface element by ID from an AFFiNE document, with an option to remove connectors that reference the deleted element.

Instructions

Delete a surface element by id. Set pruneConnectors=true to also delete any connectors whose source or target referenced the deleted element.

Input Schema

NameRequiredDescriptionDefault
docIdYesDocument ID
elementIdYesElement ID to delete
workspaceIdNoWorkspace ID (optional if default set)
pruneConnectorsNoAlso delete connectors referencing this element (default false)
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
errorNo
reasonNo
deletedNo
detailsNo
causeCodeNo
elementIdNo
retryableNo
prunedConnectorsNo
recoveryGuidanceNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv3.10.2

TDQS

A3.8/5.0
Behavior4/5

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

The annotations already declare destructiveHint=true and idempotentHint=false, so the core safety profile is known. The description adds meaningful cascade behavior: if pruneConnectors=true, connectors whose source or target referenced the deleted element are also deleted. That is a useful side effect beyond the annotations, though it omits concurrency and workspace-side effects covered by the schema.

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 two tightly written sentences with no waste. The primary action is front-loaded, followed immediately by the one important optional side-effect flag.

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?

With a full input schema, an output schema present, and annotations covering destructiveness and idempotency, the description supplies the main behavioral detail an agent needs: the pruneConnectors cascade. The concurrency semantics of expectedRevision are left to the schema, which is acceptable given full coverage.

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%, so all five parameters are already documented, including expectedRevision and workspaceId. The description mentions elementId and adds a behavioral explanation for pruneConnectors, but largely restates what the schema already says. Baseline 3 is appropriate.

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 states a specific verb and resource: 'Delete a surface element by id.' This clearly distinguishes it from sibling surface-element tools such as add_surface_element, list_surface_elements, and update_surface_element. However, it does not explicitly differentiate when to use delete_block or other deletion tools.

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?

The description gives one conditional usage detail: set pruneConnectors=true to also remove referencing connectors. Beyond that, it does not explain when to choose this tool versus delete_block or update_surface_element, nor does it mention any preconditions or when-not-to-use guidance.

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