Skip to main content
AgentCat automatically tracks MCP protocol events like tool calls and session initialization. Custom events let you go further and track actions specific to your application: feature usage, billing milestones, or anything else that matters to your product. Custom events appear in the session replay timeline with a bolt icon, alongside automatic MCP events. The resourceName is used as the label. Click on any custom event to see its full details, including parameters, response, and message. If isError is set to true, the event is styled as an error in the timeline.

Publishing Events

After calling agentcat.track(), use publishCustomEvent to send events tied to the current session. Pass the tracked server instance as the first argument.

Using a Session ID

If you have a session ID instead of the server instance, you can pass it directly as a string. AgentCat will derive a stable session from it.

publishCustomEvent Reference

Event Data

All fields in eventData are optional. You can call publishCustomEvent with just the server and project ID to record a minimal custom event. You can also enrich every auto-captured event with metadata — see Event Tags & Properties.

Examples

Tracking Feature Usage

Record when users interact with specific features to understand adoption and usage patterns.

Tracking Errors

Capture application-level errors that aren’t tied to a specific tool call.

Tracking User Milestones

Track when users reach key points in their journey, with duration to measure how long it took.