Skip to content

emit() counts items but no content reaches the MCP client #1592

Description

@daviesayo

Calling emit() in the execute tool reports a non-zero emitted count, but no content blocks are delivered to the MCP client. Only console.log output (via logs) and the return value come through.

Repro

emit("plain string emit");
emit({ type: "text", text: "mcp text block emit" });
emit({ hello: "object emit" });
return { returnedValue: "this is the return" };

Actual

{"status":"completed","result":{"returnedValue":"this is the return"},"emitted":3,"logs":[]}

The returned value arrives. All three emitted items are counted but never appear as content.

Expected

Three content items alongside the returned value, per the execute skill: "emitted items come first in the tool result, the returned value follows, and the envelope reports an emitted count so you can confirm the items landed."

Notes

  • Affects plain strings, MCP text content blocks ({ type: "text", text }), and plain objects alike.
  • Workaround is to use console.log, which does reach the client via logs.
  • Client: Claude Code, via self-hosted executor MCP server.

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