Skip to content

upsertNodes MCP tool returns EDN plain text instead of JSON #12444

@dailyherold

Description

@dailyherold

What Happened?

All write operations via the upsertNodes MCP tool return plain EDN strings instead of JSON. MCP clients throw a parse error on every write even though the write succeeds server-side. AI agents and automated clients cannot distinguish success from failure.

Affected responses:

  • Add: "Added: {:block 1}.", "Added: {:page 1, :block 1}." etc.
  • Edit: "Edited: {:block 1}."

Affects all entity types (block, page, tag, property), both HTTP API mode (-a TOKEN) and local graph mode (-g GRAPH). All read tools (listPages, getPage, searchBlocks etc.) return valid JSON correctly — only writes are affected.

Reproduce the Bug

  1. Enable HTTP API server in Logseq DB app
  2. Connect an MCP client: logseq mcp-server --stdio -a YOUR_TOKEN
  3. Call upsertNodes to add a block:
[{"operation": "add", "entityType": "block", "data": {"page-id": "PAGE-UUID", "title": "test"}}]
  1. Observe MCP client error: Unexpected token 'A', "Added: {:block 1}." is not valid JSON
  2. Check the app — the block was actually written successfully

Expected Behavior

A JSON-encoded success response, e.g. {"added": {"blocks": 1}}

Screenshots

N/A

Desktop or Mobile Platform Information

macOS 15.3, Desktop App DB version, CLI v0.4.3

Additional Context

The write succeeds but the client has no way to know. This makes upsertNodes unreliable for any automated or agent-based workflow.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions