Skip to content

Commit cdc2fe9

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add mcp step subtype to synthetics multi-step api tests (#4114)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 7605580 commit cdc2fe9

18 files changed

Lines changed: 1254 additions & 18 deletions

.generator/schemas/v1/openapi.yaml

Lines changed: 96 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16342,6 +16342,7 @@ components:
1634216342
- udp
1634316343
- icmp
1634416344
- websocket
16345+
- mcp
1634516346
example: http
1634616347
type: string
1634716348
x-enum-varnames:
@@ -16353,6 +16354,7 @@ components:
1635316354
- UDP
1635416355
- ICMP
1635516356
- WEBSOCKET
16357+
- MCP
1635616358
SyntheticsAPITestType:
1635716359
default: "api"
1635816360
description: Type of the Synthetic test, `api`.
@@ -16475,6 +16477,8 @@ components:
1647516477
- $ref: "#/components/schemas/SyntheticsAssertionJSONSchemaTarget"
1647616478
- $ref: "#/components/schemas/SyntheticsAssertionXPathTarget"
1647716479
- $ref: "#/components/schemas/SyntheticsAssertionJavascript"
16480+
- $ref: "#/components/schemas/SyntheticsAssertionMCPServerCapabilitiesTarget"
16481+
- $ref: "#/components/schemas/SyntheticsAssertionMCPRespectsSpecification"
1647816482
SyntheticsAssertionBodyHashOperator:
1647916483
description: Assertion operator to apply.
1648016484
enum:
@@ -16610,6 +16614,49 @@ components:
1661016614
type: string
1661116615
x-enum-varnames:
1661216616
- JAVASCRIPT
16617+
SyntheticsAssertionMCPRespectsSpecification:
16618+
description: An assertion that verifies the MCP server response respects the MCP specification.
16619+
properties:
16620+
type:
16621+
$ref: "#/components/schemas/SyntheticsAssertionMCPRespectsSpecificationType"
16622+
required:
16623+
- type
16624+
type: object
16625+
SyntheticsAssertionMCPRespectsSpecificationType:
16626+
description: Type of the assertion.
16627+
enum:
16628+
- mcpRespectsSpecification
16629+
example: mcpRespectsSpecification
16630+
type: string
16631+
x-enum-varnames:
16632+
- MCP_RESPECTS_SPECIFICATION
16633+
SyntheticsAssertionMCPServerCapabilitiesTarget:
16634+
description: An assertion that checks that an MCP server advertises the expected capabilities.
16635+
properties:
16636+
operator:
16637+
$ref: "#/components/schemas/SyntheticsAssertionOperator"
16638+
target:
16639+
description: List of MCP server capabilities to assert against.
16640+
example:
16641+
- completions
16642+
items:
16643+
$ref: "#/components/schemas/SyntheticsMCPServerCapability"
16644+
type: array
16645+
type:
16646+
$ref: "#/components/schemas/SyntheticsAssertionMCPServerCapabilitiesType"
16647+
required:
16648+
- type
16649+
- operator
16650+
- target
16651+
type: object
16652+
SyntheticsAssertionMCPServerCapabilitiesType:
16653+
description: Type of the assertion.
16654+
enum:
16655+
- mcpServerCapabilities
16656+
example: mcpServerCapabilities
16657+
type: string
16658+
x-enum-varnames:
16659+
- MCP_SERVER_CAPABILITIES
1661316660
SyntheticsAssertionOperator:
1661416661
description: Assertion operator to apply.
1661516662
enum:
@@ -16712,6 +16759,8 @@ components:
1671216759
- connection
1671316760
- multiNetworkHop
1671416761
- jitter
16762+
- mcpToolNameLength
16763+
- mcpToolCount
1671516764
example: statusCode
1671616765
type: string
1671716766
x-enum-varnames:
@@ -16736,6 +16785,8 @@ components:
1673616785
- CONNECTION
1673716786
- MULTI_NETWORK_HOP
1673816787
- JITTER
16788+
- MCP_TOOL_NAME_LENGTH
16789+
- MCP_TOOL_COUNT
1673916790
SyntheticsAssertionXPathOperator:
1674016791
description: Assertion operator to apply.
1674116792
enum:
@@ -18044,6 +18095,31 @@ components:
1804418095
$ref: "#/components/schemas/SyntheticsLocation"
1804518096
type: array
1804618097
type: object
18098+
SyntheticsMCPProtocolVersion:
18099+
description: The MCP protocol version used by the step. See https://modelcontextprotocol.io/specification.
18100+
enum:
18101+
- "2025-06-18"
18102+
example: "2025-06-18"
18103+
type: string
18104+
x-enum-varnames:
18105+
- VERSION_2025_06_18
18106+
SyntheticsMCPServerCapability:
18107+
description: A capability advertised by an MCP server.
18108+
enum:
18109+
- completions
18110+
- experimental
18111+
- logging
18112+
- prompts
18113+
- resources
18114+
- tools
18115+
type: string
18116+
x-enum-varnames:
18117+
- COMPLETIONS
18118+
- EXPERIMENTAL
18119+
- LOGGING
18120+
- PROMPTS
18121+
- RESOURCES
18122+
- TOOLS
1804718123
SyntheticsMobileStep:
1804818124
description: The steps used in a Synthetic mobile test.
1804918125
properties:
@@ -18933,15 +19009,24 @@ components:
1893319009
- UPLOAD_FILES
1893419010
- WAIT
1893519011
SyntheticsTestCallType:
18936-
description: The type of gRPC call to perform.
19012+
description: |-
19013+
The type of call to perform. Used by gRPC steps (`healthcheck`, `unary`)
19014+
and MCP steps (`init`, `tool_list`, `tool_call`). Valid values depend on
19015+
the parent step's `subtype`.
1893719016
enum:
1893819017
- healthcheck
1893919018
- unary
19019+
- init
19020+
- tool_list
19021+
- tool_call
1894019022
example: unary
1894119023
type: string
1894219024
x-enum-varnames:
1894319025
- HEALTHCHECK
1894419026
- UNARY
19027+
- INIT
19028+
- TOOL_LIST
19029+
- TOOL_CALL
1894519030
SyntheticsTestCiOptions:
1894619031
description: CI/CD options for a Synthetic test.
1894719032
properties:
@@ -19442,6 +19527,8 @@ components:
1944219527
isMessageBase64Encoded:
1944319528
description: Whether the message is base64 encoded.
1944419529
type: boolean
19530+
mcpProtocolVersion:
19531+
$ref: "#/components/schemas/SyntheticsMCPProtocolVersion"
1944519532
message:
1944619533
description: Message to send for UDP or WebSocket tests.
1944719534
type: string
@@ -19486,6 +19573,14 @@ components:
1948619573
description: Timeout in seconds for the test.
1948719574
format: double
1948819575
type: number
19576+
toolArgs:
19577+
additionalProperties: {}
19578+
description: Arguments to pass to the MCP tool. Free-form object whose shape depends on the tool. Used when `callType` is `tool_call`.
19579+
type: object
19580+
toolName:
19581+
description: The name of the MCP tool to call. Required when `callType` is `tool_call`.
19582+
example: search
19583+
type: string
1948919584
url:
1949019585
description: URL to perform the test with.
1949119586
example: "https://example.com"

api/datadogV1/model_synthetics_api_test_step_subtype.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ const (
2323
SYNTHETICSAPITESTSTEPSUBTYPE_UDP SyntheticsAPITestStepSubtype = "udp"
2424
SYNTHETICSAPITESTSTEPSUBTYPE_ICMP SyntheticsAPITestStepSubtype = "icmp"
2525
SYNTHETICSAPITESTSTEPSUBTYPE_WEBSOCKET SyntheticsAPITestStepSubtype = "websocket"
26+
SYNTHETICSAPITESTSTEPSUBTYPE_MCP SyntheticsAPITestStepSubtype = "mcp"
2627
)
2728

2829
var allowedSyntheticsAPITestStepSubtypeEnumValues = []SyntheticsAPITestStepSubtype{
@@ -34,6 +35,7 @@ var allowedSyntheticsAPITestStepSubtypeEnumValues = []SyntheticsAPITestStepSubty
3435
SYNTHETICSAPITESTSTEPSUBTYPE_UDP,
3536
SYNTHETICSAPITESTSTEPSUBTYPE_ICMP,
3637
SYNTHETICSAPITESTSTEPSUBTYPE_WEBSOCKET,
38+
SYNTHETICSAPITESTSTEPSUBTYPE_MCP,
3739
}
3840

3941
// GetAllowedValues reeturns the list of possible values.

api/datadogV1/model_synthetics_assertion.go

Lines changed: 70 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@ import (
1111
// SyntheticsAssertion - Object describing the assertions type, their associated operator,
1212
// which property they apply, and upon which target.
1313
type SyntheticsAssertion struct {
14-
SyntheticsAssertionTarget *SyntheticsAssertionTarget
15-
SyntheticsAssertionBodyHashTarget *SyntheticsAssertionBodyHashTarget
16-
SyntheticsAssertionJSONPathTarget *SyntheticsAssertionJSONPathTarget
17-
SyntheticsAssertionJSONSchemaTarget *SyntheticsAssertionJSONSchemaTarget
18-
SyntheticsAssertionXPathTarget *SyntheticsAssertionXPathTarget
19-
SyntheticsAssertionJavascript *SyntheticsAssertionJavascript
14+
SyntheticsAssertionTarget *SyntheticsAssertionTarget
15+
SyntheticsAssertionBodyHashTarget *SyntheticsAssertionBodyHashTarget
16+
SyntheticsAssertionJSONPathTarget *SyntheticsAssertionJSONPathTarget
17+
SyntheticsAssertionJSONSchemaTarget *SyntheticsAssertionJSONSchemaTarget
18+
SyntheticsAssertionXPathTarget *SyntheticsAssertionXPathTarget
19+
SyntheticsAssertionJavascript *SyntheticsAssertionJavascript
20+
SyntheticsAssertionMCPServerCapabilitiesTarget *SyntheticsAssertionMCPServerCapabilitiesTarget
21+
SyntheticsAssertionMCPRespectsSpecification *SyntheticsAssertionMCPRespectsSpecification
2022

2123
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
2224
UnparsedObject interface{}
@@ -52,6 +54,16 @@ func SyntheticsAssertionJavascriptAsSyntheticsAssertion(v *SyntheticsAssertionJa
5254
return SyntheticsAssertion{SyntheticsAssertionJavascript: v}
5355
}
5456

57+
// SyntheticsAssertionMCPServerCapabilitiesTargetAsSyntheticsAssertion is a convenience function that returns SyntheticsAssertionMCPServerCapabilitiesTarget wrapped in SyntheticsAssertion.
58+
func SyntheticsAssertionMCPServerCapabilitiesTargetAsSyntheticsAssertion(v *SyntheticsAssertionMCPServerCapabilitiesTarget) SyntheticsAssertion {
59+
return SyntheticsAssertion{SyntheticsAssertionMCPServerCapabilitiesTarget: v}
60+
}
61+
62+
// SyntheticsAssertionMCPRespectsSpecificationAsSyntheticsAssertion is a convenience function that returns SyntheticsAssertionMCPRespectsSpecification wrapped in SyntheticsAssertion.
63+
func SyntheticsAssertionMCPRespectsSpecificationAsSyntheticsAssertion(v *SyntheticsAssertionMCPRespectsSpecification) SyntheticsAssertion {
64+
return SyntheticsAssertion{SyntheticsAssertionMCPRespectsSpecification: v}
65+
}
66+
5567
// UnmarshalJSON turns data into one of the pointers in the struct.
5668
func (obj *SyntheticsAssertion) UnmarshalJSON(data []byte) error {
5769
var err error
@@ -158,6 +170,40 @@ func (obj *SyntheticsAssertion) UnmarshalJSON(data []byte) error {
158170
obj.SyntheticsAssertionJavascript = nil
159171
}
160172

173+
// try to unmarshal data into SyntheticsAssertionMCPServerCapabilitiesTarget
174+
err = datadog.Unmarshal(data, &obj.SyntheticsAssertionMCPServerCapabilitiesTarget)
175+
if err == nil {
176+
if obj.SyntheticsAssertionMCPServerCapabilitiesTarget != nil && obj.SyntheticsAssertionMCPServerCapabilitiesTarget.UnparsedObject == nil {
177+
jsonSyntheticsAssertionMCPServerCapabilitiesTarget, _ := datadog.Marshal(obj.SyntheticsAssertionMCPServerCapabilitiesTarget)
178+
if string(jsonSyntheticsAssertionMCPServerCapabilitiesTarget) == "{}" { // empty struct
179+
obj.SyntheticsAssertionMCPServerCapabilitiesTarget = nil
180+
} else {
181+
match++
182+
}
183+
} else {
184+
obj.SyntheticsAssertionMCPServerCapabilitiesTarget = nil
185+
}
186+
} else {
187+
obj.SyntheticsAssertionMCPServerCapabilitiesTarget = nil
188+
}
189+
190+
// try to unmarshal data into SyntheticsAssertionMCPRespectsSpecification
191+
err = datadog.Unmarshal(data, &obj.SyntheticsAssertionMCPRespectsSpecification)
192+
if err == nil {
193+
if obj.SyntheticsAssertionMCPRespectsSpecification != nil && obj.SyntheticsAssertionMCPRespectsSpecification.UnparsedObject == nil {
194+
jsonSyntheticsAssertionMCPRespectsSpecification, _ := datadog.Marshal(obj.SyntheticsAssertionMCPRespectsSpecification)
195+
if string(jsonSyntheticsAssertionMCPRespectsSpecification) == "{}" { // empty struct
196+
obj.SyntheticsAssertionMCPRespectsSpecification = nil
197+
} else {
198+
match++
199+
}
200+
} else {
201+
obj.SyntheticsAssertionMCPRespectsSpecification = nil
202+
}
203+
} else {
204+
obj.SyntheticsAssertionMCPRespectsSpecification = nil
205+
}
206+
161207
if match != 1 { // more than 1 match
162208
// reset to nil
163209
obj.SyntheticsAssertionTarget = nil
@@ -166,6 +212,8 @@ func (obj *SyntheticsAssertion) UnmarshalJSON(data []byte) error {
166212
obj.SyntheticsAssertionJSONSchemaTarget = nil
167213
obj.SyntheticsAssertionXPathTarget = nil
168214
obj.SyntheticsAssertionJavascript = nil
215+
obj.SyntheticsAssertionMCPServerCapabilitiesTarget = nil
216+
obj.SyntheticsAssertionMCPRespectsSpecification = nil
169217
return datadog.Unmarshal(data, &obj.UnparsedObject)
170218
}
171219
return nil // exactly one match
@@ -197,6 +245,14 @@ func (obj SyntheticsAssertion) MarshalJSON() ([]byte, error) {
197245
return datadog.Marshal(&obj.SyntheticsAssertionJavascript)
198246
}
199247

248+
if obj.SyntheticsAssertionMCPServerCapabilitiesTarget != nil {
249+
return datadog.Marshal(&obj.SyntheticsAssertionMCPServerCapabilitiesTarget)
250+
}
251+
252+
if obj.SyntheticsAssertionMCPRespectsSpecification != nil {
253+
return datadog.Marshal(&obj.SyntheticsAssertionMCPRespectsSpecification)
254+
}
255+
200256
if obj.UnparsedObject != nil {
201257
return datadog.Marshal(obj.UnparsedObject)
202258
}
@@ -229,6 +285,14 @@ func (obj *SyntheticsAssertion) GetActualInstance() interface{} {
229285
return obj.SyntheticsAssertionJavascript
230286
}
231287

288+
if obj.SyntheticsAssertionMCPServerCapabilitiesTarget != nil {
289+
return obj.SyntheticsAssertionMCPServerCapabilitiesTarget
290+
}
291+
292+
if obj.SyntheticsAssertionMCPRespectsSpecification != nil {
293+
return obj.SyntheticsAssertionMCPRespectsSpecification
294+
}
295+
232296
// all schemas are nil
233297
return nil
234298
}

0 commit comments

Comments
 (0)