Hello Andrew McGregor,
Welcome to Microsoft Q&A and Thank you for reaching out.
Yes, this behavior is expected when using MCP tools in Azure AI Foundry.
Why this is happening
Azure AI Foundry enforces stricter schema validation rules for MCP tools than full JSON Schema specifications. While your schema is valid JSON Schema, Foundry only supports a limited subset of schema features. Validation keywords such as anyOf are not supported and will cause the tool invocation to fail with:
Invalid tool schema
This is why the tool may register successfully but fails during execution.
What schema rules Foundry enforces
Foundry expects simple, deterministic schemas for tool inputs.
Supported
-
type: "object" -
propertieswith a single concrete type-
string,number,boolean
-
-
required -
description -
title
Not supported
-
anyOf,oneOf,allOf - Nullable union types (e.g.,
string | null) - Complex validation logic
- Advanced JSON Schema constructs
Foundry does not support nullable fields defined via unions.
Why nullable fields fail
Patterns like this are rejected:
"priority": {
"anyOf": [
{ "type": "string" },
{ "type": "null" }
]
}
Foundry requires each property to have exactly one type.
How to fix your schema
Simplify the schema
Remove anyOf and similar constructs
Define optional parameters using a single type
Only list truly required fields in the required array
Omit optional fields from the request instead of passing null
Example
{
"type": "object",
"properties": {
"short_description": {
"type": "string",
"description": "Short description of the incident"
},
"description": {
"type": "string",
"description": "Detailed description of the incident"
},
"priority": {
"type": "string",
"description": "Priority of the incident"
}
},
"required": ["short_description"]
}
Recommended troubleshooting steps,
Start with a minimal schema Define only one required field and confirm the tool executes successfully.
Add properties incrementally This helps identify which schema element triggers validation failure.
Avoid OpenAPI-generated schemas without cleanup Auto-generated schemas often include unsupported constructs and require simplification before use with Foundry.
Foundry validates MCP tool schemas using a restricted schema subset
Keywords like anyOf are not supported
Nullable fields must be handled by omission, not unions
Simplified, single-type schemas are required
This is a platform limitation, not an issue with your MCP server logic
Once the schema is simplified to match Foundry’s expectations, the tool should execute correctly.
Please refer this https://learn.microsoft.com/en-us/azure/developer/azure-mcp-server/tools/azure-foundry?wt.mc_id=knowledgesearch_inproduct_azure-cxp-community-insider
I Hope this helps. Do let me know if you have any further queries.
Thank you!