---
title: "Create a new env_sync graph node (skill/hook/mcp_server/secret/setting_fragment). Same-alias collisions open a conflict bucket — no silent overwrite."
method: POST
path: "/api/mcp/tools/graph_add_entity"
tags: ["misc"]
---

# Create a new env_sync graph node (skill/hook/mcp_server/secret/setting_fragment). Same-alias collisions open a conflict bucket — no silent overwrite.

`POST /api/mcp/tools/graph_add_entity`

## Request

- Base URL: `https://api.ainote.dev`
- URL: `https://api.ainote.dev/api/mcp/tools/graph_add_entity`
- Auth: API key in header `Authorization`

Create a new env_sync graph node (skill/hook/mcp_server/secret/setting_fragment). Same-alias collisions open a conflict bucket — no silent overwrite.

## Request body

- object
  - `node_type` 'skill' | 'hook' | 'mcp_server' | 'secret' | 'setting_fragment', required
  - `alias` string, required
  - `payload` object, required
  - `device_id` string, uuid, required
  - `client_hlc` string

## Response `200`

Tool executed successfully

- ToolSuccessResponse: Successful tool invocation. `content` mirrors the MCP `tools/call` result shape: an array of content blocks (text and optionally a structured resource payload).
  - `content` object[]
    - `type` 'text' | 'resource'
    - `text` string

## Other responses

- `400`: Invalid arguments or business-rule violation
- `401`: Missing or invalid McpKey

---

[API](https://skmtc.dev/ainote/apis/ainote-mcp-openapi-mirror.md) · [All operations](https://skmtc.dev/ainote/apis/ainote-mcp-openapi-mirror/llms.txt) · [OpenAPI document](https://skmtc.dev/ainote/apis/ainote-mcp-openapi-mirror/revisions/f6c91d85e027?raw)
