Skip to content

feat(usage): tool_call on usage events for MCP gateways - #29

Merged
coyl merged 1 commit into
mainfrom
feat/mcp-tool-calls
Oct 27, 2026
Merged

coyl merged 1 commit into
mainfrom
feat/mcp-tool-calls

Conversation

@coyl

@coyl coyl commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Keystone's MCP gateway (ai-process/ktms#136) sends one event per forwarded tool call: vendor mcp, model server__tool, no tokens, and the new tool_call (server, tool, response_bytes). Additive field 19 in usage.v1; stored as tool_server, tool_name, response_bytes in Postgres (migration 009) and ClickHouse (005), carried by the outbox and replicator; accepted over gRPC and HTTP and validated (both names set, lengths, size >= 0). Task: ai-process/docs#183.

Verified: go vet, go test ./... -race against Postgres and ClickHouse, and end to end from a KTMS build: events (including ones held during an outage) arrive with tool_call stored.

An MCP gateway such as Keystone's sends one event per tool call it forwards:
vendor mcp, model server__tool, no tokens, and tool_call with the server, the
tool and the result's size. They are stored in Postgres and ClickHouse as
tool_server, tool_name and response_bytes; the field is only added to
usage.v1.

docs#183
@coyl
coyl merged commit 6fc4e81 into main Oct 27, 2026
6 checks passed
@coyl
coyl deleted the feat/mcp-tool-calls branch October 27, 2026 21:16
@coyl coyl mentioned this pull request Oct 27, 2026
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