Skip to content

feat(mcp-server): add get-node-stat tool — node archive statistics#13

Open
MalishkinMV wants to merge 1 commit into
corezoid:mainfrom
MalishkinMV:feat/get-node-stat
Open

feat(mcp-server): add get-node-stat tool — node archive statistics#13
MalishkinMV wants to merge 1 commit into
corezoid:mainfrom
MalishkinMV:feat/get-node-stat

Conversation

@MalishkinMV
Copy link
Copy Markdown
Contributor

@MalishkinMV MalishkinMV commented May 29, 2026

Summary

Adds get-node-stat MCP tool to the Go MCP server.

The tool exposes the Corezoid archive statistics API — the same data visible in the Corezoid UI under /diagram/{node_id}/archive. Previously this was only accessible by manually crafting raw API requests.

Usage

get-node-stat(
  process_id=<conv_id>,
  node_id=<node_id from UI archive URL>,
  start=<unix_timestamp>,
  end=<unix_timestamp>,
  interval="day",          // or "hour"
  timezone_offset=<utc_offset_minutes>
)

Response: ops[0]['data'] — array of {"date": "YYYY-MM-DD", "in": N, "out": M} for non-zero buckets. ops[0]['title'] contains the node title.

Changes

  • mcp_server.go — tool definition + case "get-node-stat" handler in handleToolCall

Test plan

  • Returns data array with date/in/out for a node with traffic
  • Returns data: [] for nodes with no traffic in range
  • interval="hour" works for short ranges
  • node not found error returned gracefully for invalid node_id
  • go build ./... passes ✅

🤖 Generated with Claude Code

Exposes the Corezoid archive statistics API as a first-class MCP tool.
get-node-stat returns time-series in/out counts per day or hour for
any node, using the node_id from the Corezoid UI archive URL
(/diagram/{node_id}/archive).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@MalishkinMV MalishkinMV force-pushed the feat/get-node-stat branch from b5a5095 to e110845 Compare May 29, 2026 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant