Skip to main content
AgentCat tracks each tool call of your MCP server by itself. 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, next to the tool calls. AgentCat uses the resourceName as the label. You can click any custom event to see its full details, including parameters, response, and message. If isError is true, the timeline styles the event as an error.

Publishing events

After track(), publishCustomEvent sends an event for a tracked server. Its first argument is the tracked server instance:
An event that you publish for a server has no session, unless its data gives a sessionId (session_id in Python). A tracked server can serve many tasks at once, so AgentCat cannot know by itself which session the event belongs to. The Rust SDK can also publish from inside a tool call, in the session of that call: see the Rust reference.

Using a session ID

If you know the ses_ ID of a session instead of the server instance, you can pass it as a string. AgentCat uses the string as the session ID of the event, unchanged:

publishCustomEvent reference

Event data

All fields are optional. A call with only the server and the project ID records a minimal custom event. You can also add metadata to every tool-call event that AgentCat captures: see Event Tags & Properties.

Custom events in your language

Each SDK has a function with these fields, named for the style of its language. The reference page of each language has more about it, from a short note to a full section with an example:

Examples

Tracking feature usage

You can record when users work with specific features, to understand adoption and usage patterns.

Tracking errors

You can capture application errors that are not tied to a specific tool call.

Tracking user milestones

You can track when users reach key points in their journey, with a duration that measures how long it took.