Skip to main content

Overview

MCPcat automatically injects a context parameter into your tool schemas. When an AI agent calls one of your tools, it fills in this parameter with a short explanation of why it’s making the call. MCPcat captures this as the event’s agent intent and strips it from the arguments before your tool handler runs. For a deeper look at how this works under the hood, see How MCPcat Works. This feature is enabled by default. You can customize the prompt that guides the AI’s response, or disable it entirely.

Customizing the Description

The default description asks the AI to provide a 15-25 word explanation in third person. If you want to tailor the prompt to your domain, pass a customContextDescription:
import * as mcpcat from "mcpcat"

mcpcat.track(mcpServer, "proj_abc123xyz", {
  customContextDescription: "Describe the business objective this tool call supports and which team requested it."
})

The description you provide replaces the default prompt entirely. Write it as an instruction directed at the AI client.

Tips for Writing a Good Description

A few things to keep in mind when writing your own context description:
  • Be specific to your domain. Instead of “explain why you’re calling this tool”, try “describe which customer request or support ticket this action relates to.”
  • Set a word count. LLMs tend to be verbose. Asking for 15-25 words keeps the context concise and useful for analytics.
  • Ask for third person. First-person context (“I need to…”) is less useful for analytics than third-person (“Searching for…”).
  • Remind about sensitive data. If your tools handle credentials or personal information, instruct the AI not to include those in the context string.

Disabling Context Collection

If you don’t want MCPcat to modify your tool schemas, disable context collection:
mcpcat.track(mcpServer, "proj_abc123xyz", {
  enableToolCallContext: false
})
Disabling context collection means you won’t see user intent data in the dashboard or session replays. Tool calls will still be tracked, but without the “why” behind each call.