ViiVo / 开发者文档
能力参考画布与节点

删除画布节点

按当前画布版本删除指定节点及其相连边。

delete_canvas_node

按当前画布版本删除指定节点及其相连边。

参数与调用

delete_canvas_node包含写入操作

此操作会实际修改数据或提交任务。生成任务可能产生费用;先读取目标 ID 和版本,同一次请求的重试复用幂等键。

调试台中选择 delete_canvas_node/minimal 示例。文档中的 ID 均为占位值,请替换成服务端返回的真实值。

验证范围:已核对当前 Facade 路由和请求字段;MCP 转发及 Facade PostgreSQL 集成测试通过。 不包含真实付费生成的端到端验收。

调用前提

需要当前画布的有效编辑授权;Agent 使用服务端保存的画布聊天运行授权。Bearer Token 本身不授予编辑权。base_revision 使用最近读取的 layout.revision,冲突后重新读取。

参数说明

以下字段放入工具的 arguments 对象内。“必填”指所在对象内必填;可选对象省略时无需填写其内部字段。空值与省略的含义以该字段 Schema 为准。

project_idstring必填

项目的规范 ID,由管理员或当前项目上下文提供;调用身份仍需具备项目权限。

minLength: 1 · maxLength: 255 · pattern: "^(?!\\.{1,2}$)[^/\\\\?#%\\x00-\\x20\\x7f]+$"
canvas_idstring必填

项目内的画布 ID,从画布列表或当前画布上下文获取。

pattern: "^[a-zA-Z0-9_-]{1,64}$"
node_idstring必填

目标节点的精确 ID,从 get_canvas 的 layout.nodes 获取;不能用名称替代。

minLength: 1 · maxLength: 255 · pattern: "^(?!\\.{1,2}$)[^/\\\\?#%\\x00-\\x20\\x7f]+$"
base_revisioninteger必填

get_canvas 返回的画布版本。冲突时重新读取并合并用户修改,再提交。

minimum: 0
client_save_idstring | null可选

客户端为一次保存分配的关联标识,供识别保存回执。

default: null
完整输入 JSON Schema(包含组合条件、枚举与引用)
{
  "properties": {
    "project_id": {
      "type": "string",
      "minLength": 1,
      "pattern": "^(?!\\.{1,2}$)[^/\\\\?#%\\x00-\\x20\\x7f]+$",
      "maxLength": 255,
      "description": "项目的规范 ID,由管理员或当前项目上下文提供;调用身份仍需具备项目权限。"
    },
    "canvas_id": {
      "type": "string",
      "pattern": "^[a-zA-Z0-9_-]{1,64}$",
      "description": "项目内的画布 ID,从画布列表或当前画布上下文获取。"
    },
    "node_id": {
      "type": "string",
      "minLength": 1,
      "pattern": "^(?!\\.{1,2}$)[^/\\\\?#%\\x00-\\x20\\x7f]+$",
      "maxLength": 255,
      "description": "目标节点的精确 ID,从 get_canvas 的 layout.nodes 获取;不能用名称替代。"
    },
    "base_revision": {
      "type": "integer",
      "minimum": 0,
      "description": "get_canvas 返回的画布版本。冲突时重新读取并合并用户修改,再提交。"
    },
    "client_save_id": {
      "anyOf": [
        {
          "type": "string",
          "minLength": 1,
          "pattern": "\\S",
          "maxLength": 128
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "客户端为一次保存分配的关联标识,供识别保存回执。"
    }
  },
  "required": [
    "project_id",
    "canvas_id",
    "node_id",
    "base_revision"
  ],
  "title": "delete_canvas_nodeArguments",
  "type": "object",
  "additionalProperties": false
}

完整调用示例

delete_canvas_node / minimal

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "delete_canvas_node",
    "arguments": {
      "project_id": "01EXAMPLEPROJECT00000000000",
      "canvas_id": "default",
      "node_id": "node-example",
      "base_revision": 1
    }
  }
}

将示例保存为 request.json 后发送:

curl https://mcp.viivo.djagon.com/mcp/ \
  -H "Authorization: Bearer $MCP_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "MCP-Protocol-Version: 2025-06-18" \
  --data-binary @request.json

如何读取结果

先检查 HTTP 状态,再检查 JSON-RPC 的 error 与 result.isError。工具返回内容位于 result.content;如有结构化结果则同时查看 result.structuredContent。HTTP 200 不代表业务成功。

工具声明的输出 Schema
{
  "additionalProperties": true,
  "title": "delete_canvas_nodeDictOutput",
  "type": "object"
}

具体处理见 结果与错误处理。

原始工具契约说明

Atomically delete one node and its connected edges using the current revision.

本页内容