You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The MCP server-side integration instruments [`initialize`][3] and [`tools/call`][4] MCP methods. [`tools/list`][5] calls are optionally intercepted when intent capture is enabled.
552
+
553
+
The following tags are recorded on server spans:
554
+
-`mcp_method`: The MCP method called.
555
+
-`mcp_session_id`: The MCP [session ID][6], recorded when available in the request.
556
+
-`client_name`: The name of the client as provided to `initialize`.
557
+
-`client_version`: The version of the client as provided to `initialize`.
: optional - _integer or string_ - **default**: `false`
97
+
<br />When set to `1` or `true`, adds an argument to every MCP tool requesting that the calling model describe why it chose to call the tool. The intent is recorded on the tool span.
Enable Agent Observability by running your application with `NODE_OPTIONS="--import dd-trace/initialize.mjs"` and specifying the required environment variables.
100
104
@@ -224,6 +228,10 @@ LLMObs.enable(
224
228
: optional - _string_
225
229
<br />The name of the service used for your application. If not provided, this defaults to the value of `DD_SERVICE`.
226
230
231
+
`capture_intent`
232
+
: optional - _boolean_ - **default**: `false`
233
+
<br />When set to `True`, adds an argument to every MCP server tool requesting that the calling model describe why it chose to call the tool. The intent is recorded on the tool span. If not provided, this defaults to the value of `DD_MCP_CAPTURE_INTENT`.
@@ -1957,6 +1965,33 @@ The versioning system works as follows:
1957
1965
1958
1966
This gives you the flexibility to either rely on automatic version management based on template content changes, or maintain full control over versioning with your own version labels.
1959
1967
1968
+
## MCP intent capture
1969
+
1970
+
To gain insight into why your MCP tools were called, enable intent capture on your MCP server. When enabled, the SDK adds an argument to every MCP tool requesting that the calling model describe why it chose to call the tool. The intent is recorded on the tool span, helping you improve your tool definitions and descriptions.
1971
+
1972
+
{{< tabs >}}
1973
+
{{% tab "Python" %}}
1974
+
1975
+
Enable MCP intent capture with the `DD_MCP_CAPTURE_INTENT` environment variable:
Or, enable it programmatically with the `capture_intent` parameter on `LLMObs.enable()`:
1983
+
1984
+
{{< code-block lang="python" >}}
1985
+
from ddtrace.llmobs import LLMObs
1986
+
LLMObs.enable(
1987
+
ml_app="<YOUR_ML_APP_NAME>",
1988
+
capture_intent=True,
1989
+
)
1990
+
{{< /code-block >}}
1991
+
1992
+
{{% /tab %}}
1993
+
{{< /tabs >}}
1994
+
1960
1995
## Cost monitoring
1961
1996
Attach token metrics (for automatic cost tracking) or cost metrics (for manual cost tracking) to your LLM/embedding spans. Token metrics allow Datadog to calculate costs using provider pricing, while cost metrics let you supply your own pricing when using custom or unsupported models. For more details, see [Costs][14].
0 commit comments