fix(catalog-mcp): create-product could never succeed
The tool's request schema omitted productcode, which catalog-api requires
(ProductRequest in openapi.yaml lists it among the eight required fields).
Since the declared schema is the only thing an MCP caller sees, there was no
input that worked: omit it and the API answers
{"productcode":["This field is required."]}; supply it and ai-mcp-proxy rejects
the call first with "Additional properties are not allowed ('productcode' was
unexpected)".
The schema now mirrors ProductRequest — productcode added, the same eight
fields marked required, and the length and format constraints carried over so
a model reads them rather than guessing.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -72,25 +72,50 @@ config:
|
|||||||
required: true
|
required: true
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
|
# Mirrors ProductRequest in catalog-api/openapi.yaml. It has to:
|
||||||
|
# this schema is the only thing the caller sees, so anything it
|
||||||
|
# omits the caller cannot send. `productcode` was missing and is
|
||||||
|
# required by the API, which made this tool impossible to call
|
||||||
|
# successfully — every attempt came back
|
||||||
|
# {"productcode":["This field is required."]}, and a caller that
|
||||||
|
# tried to supply it anyway was rejected earlier still, here.
|
||||||
schema:
|
schema:
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
|
productcode:
|
||||||
|
type: string
|
||||||
|
maxLength: 15
|
||||||
|
description: Unique catalog identifier, e.g. S10_1949. Ask for it; do not invent one.
|
||||||
productname:
|
productname:
|
||||||
type: string
|
type: string
|
||||||
|
maxLength: 70
|
||||||
productline:
|
productline:
|
||||||
type: string
|
type: string
|
||||||
|
description: Must be an existing product line, as returned by list-productlines.
|
||||||
productscale:
|
productscale:
|
||||||
type: string
|
type: string
|
||||||
|
maxLength: 10
|
||||||
productvendor:
|
productvendor:
|
||||||
type: string
|
type: string
|
||||||
|
maxLength: 50
|
||||||
productdescription:
|
productdescription:
|
||||||
type: string
|
type: string
|
||||||
quantityinstock:
|
quantityinstock:
|
||||||
type: integer
|
type: integer
|
||||||
|
minimum: -32768
|
||||||
|
maximum: 32767
|
||||||
buyprice:
|
buyprice:
|
||||||
type: string
|
type: string
|
||||||
|
description: Decimal as a string, at most two places, e.g. "50.00".
|
||||||
msrp:
|
msrp:
|
||||||
type: string
|
type: string
|
||||||
|
description: Decimal as a string, at most two places, e.g. "99.00".
|
||||||
required:
|
required:
|
||||||
|
- productcode
|
||||||
- productname
|
- productname
|
||||||
- productline
|
- productline
|
||||||
|
- productscale
|
||||||
|
- productvendor
|
||||||
|
- productdescription
|
||||||
|
- buyprice
|
||||||
|
- msrp
|
||||||
|
|||||||
Reference in New Issue
Block a user