Commit 8d9b740
feat(contrib/modelcontextprotocol/go-sdk): skip intent capture for UI-only tools (#4949)
This PR stack ports functionality added in the clone of this contrib in dd-source back to dd-trace-go (Rapid clone at `domains/api_platform/libs/go/mcp/tracing`).
## Summary
Skips telemetry/intent injection for tools whose `_meta.ui.visibility` excludes `"model"`. UI-only tools cannot be invoked by the model, so a required `telemetry` parameter would be useless noise.
`_meta.ui.visibility` is part of the MCP Apps extension (see https://github.com/modelcontextprotocol/modelcontextprotocol/blob/main/SEP-1865.md). Absent visibility list ⇒ model-callable (spec default).
## What this enables in dd-source
Same behavior already shipping in the Rapid clone — UI-only tools registered through dd-source's MCP server are silently skipped today; this PR brings that to the public contrib. Source PR: DataDog/dd-source#420911
## Test plan
- [x] `TestIntentCaptureSkipsUIOnlyTools` — three tools (no meta, ui-only, dual-visibility): only the UI-only one is skipped.
- [x] All existing intent-capture tests still pass.
Stacked on #4948.
---
Parallel port in the mark3labs/mcp-go contrib: #4942
Co-authored-by: jboolean <julian.boilen@datadoghq.com>2 files changed
Lines changed: 62 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
59 | 64 | | |
60 | 65 | | |
61 | 66 | | |
| |||
Lines changed: 57 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
70 | 127 | | |
71 | 128 | | |
72 | 129 | | |
| |||
0 commit comments