Description
zod's z.date() validation will only be successful for instances of Date , and will fail for strings or numbers -- their docs show this as an example failing a date string, but we/an agent can't really pass an instance of Date in a request.
Example
Trying to run wit_get_work_item with an input like:
{
// ...
"asOf": "2025-01-01"
}
will always fail with an output like
wit_get_work_item: [
{
"code": "invalid_type",
"expected": "date",
"received": "string",
"path": [
"asOf"
],
"message": "Expected date, received string"
}
]
because asOf is using z.date() for input validation, and that's expecting a date, not a string.
|
asOf: z.date().optional().describe("Optional date to retrieve the work item as of a specific time. If not provided, the current state will be returned."), |
This also occurs for the build and release commands that try to validate their date params with z.date().
Description
zod's
z.date()validation will only be successful for instances ofDate, and will fail for strings or numbers -- their docs show this as an example failing a date string, but we/an agent can't really pass an instance ofDatein a request.Example
Trying to run
wit_get_work_itemwith an input like:{ // ... "asOf": "2025-01-01" }will always fail with an output like
because
asOfis usingz.date()for input validation, and that's expecting a date, not a string.azure-devops-mcp/src/tools/workitems.ts
Line 159 in 4992daf
This also occurs for the build and release commands that try to validate their date params with
z.date().