> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agentcat.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Tool Call Context

> Configure how AgentCat captures agent intent from tool calls.

AgentCat 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. AgentCat 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 AgentCat Works](/how-it-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`:

<CodeGroup>
  ```typescript TypeScript theme={null}
  import * as agentcat from "agentcat"

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

  ```

  ```python Python theme={null}
  import agentcat

  agentcat.track(server, "proj_abc123xyz",
               agentcat.AgentCatOptions(
                   custom_context_description="Describe the business objective this tool call supports and which team requested it."
               ))
  ```

  ```go Go theme={null}
  import mcpcat "github.com/mcpcat/mcpcat-go-sdk/officialsdk"
  // For mark3labs/mcp-go: import mcpcat "github.com/mcpcat/mcpcat-go-sdk/mcpgo"

  mcpcat.Track(s, "proj_abc123xyz", &mcpcat.Options{
      CustomContextDescription: "Describe the business objective this tool call supports and which team requested it.",
  })
  ```
</CodeGroup>

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 AgentCat to modify your tool schemas, disable context collection:

<CodeGroup>
  ```typescript TypeScript theme={null}
  agentcat.track(mcpServer, "proj_abc123xyz", {
    enableToolCallContext: false
  })
  ```

  ```python Python theme={null}
  agentcat.track(server, "proj_abc123xyz",
               agentcat.AgentCatOptions(enable_tool_call_context=False))
  ```

  ```go Go theme={null}
  mcpcat.Track(s, "proj_abc123xyz", &mcpcat.Options{
      DisableToolCallContext: true,
  })
  ```
</CodeGroup>

<Note>
  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.
</Note>
