pub const SCHEMA_V7: &str = "
CREATE TABLE IF NOT EXISTS mcp_tool_calls (
id INTEGER PRIMARY KEY AUTOINCREMENT,
ts_ms INTEGER NOT NULL,
request_id TEXT NOT NULL,
session_id TEXT NOT NULL,
consumer TEXT NOT NULL,
tool_name TEXT NOT NULL,
allowed INTEGER NOT NULL,
duration_ms REAL NOT NULL,
error_code TEXT,
status TEXT NOT NULL
);
CREATE INDEX IF NOT EXISTS idx_mcp_tool_calls_session ON mcp_tool_calls(session_id);
CREATE INDEX IF NOT EXISTS idx_mcp_tool_calls_consumer ON mcp_tool_calls(consumer);
";Expand description
Schema v7 (DW-087): the mcp_tool_calls table. One row per MCP
tool call proxied through the gateway, carrying the session
correlation id, the authenticated consumer, the tool name, the
authorization outcome (allowed), the call duration, an optional
error code, and a status string (success, error, or denied).
The admin /mcp/calls endpoint reads these rows; the session and
consumer indexes support per-session and per-consumer drill-down.