Problem
Several high-value fields are buried inside request_json JSON blobs in the mcp_events table instead of being stored as first-class indexed columns:
| Field |
Current storage |
Impact |
hook_event |
Inside request_json.hookEvent |
Cannot efficiently query "all PreToolUse events" without JSON path scan |
tool_use_id |
Inside request_json.toolUseId |
Cannot efficiently correlate Pre/Post events without JSON extraction |
tool_input |
Inside request_json.toolInput |
Cannot index or filter by input properties |
Meanwhile tool_name and response_json are already proper columns.
Fix
This is an API/DB concern, not a CLI concern. The API handler should extract these fields from the proto message and store them in dedicated columns:
- Add
hook_event column to mcp_events (or use the existing event_type column more precisely)
- Add
tool_use_id column to mcp_events
- Consider promoting
tool_input to its own JSON column (parallel to response_json)
Requires a DB migration.
Note
This issue is tracked here for visibility but the fix lives in the API repo, not the CLI.
Problem
Several high-value fields are buried inside
request_jsonJSON blobs in themcp_eventstable instead of being stored as first-class indexed columns:hook_eventrequest_json.hookEventtool_use_idrequest_json.toolUseIdtool_inputrequest_json.toolInputMeanwhile
tool_nameandresponse_jsonare already proper columns.Fix
This is an API/DB concern, not a CLI concern. The API handler should extract these fields from the proto message and store them in dedicated columns:
hook_eventcolumn tomcp_events(or use the existingevent_typecolumn more precisely)tool_use_idcolumn tomcp_eventstool_inputto its own JSON column (parallel toresponse_json)Requires a DB migration.
Note
This issue is tracked here for visibility but the fix lives in the API repo, not the CLI.