-
Notifications
You must be signed in to change notification settings - Fork 20
Closed
Description
When the parameter of an OpenAPI specification is an enum, it is recommended to add the enum values to the parameter description in the MCP tool. This ensures that appropriate parameters are input into MCP.
Furthermore, since both parameter.description and parameter.schema.description exist, it is advisable to include both in the tool's description.
For example, modify the tool definition of "zone" in openapi.json as follows:
before
{
"name":"zone",
"description":"Returns metadata about a given zone",
"inputSchema":{
"type":"object",
"properties":{
"effective":{
"description":"Effective date/time",
"type":"string"
},
"type":{
"description":"Zone type",
"type":"string"
},
"zoneId":{
"description":"NWS public zone/county identifier",
"pattern":"^(A[KLMNRSZ]|C[AOT]|D[CE]|F[LM]|G[AMU]|I[ADLN]|K[SY]|L[ACEHMOS]|M[ADEHINOPST]|N[CDEHJMVY]|O[HKR]|P[AHKMRSWZ]|S[CDL]|T[NX]|UT|V[AIT]|W[AIVY]|[HR]I)[CZ]\\d{3}$",
"type":"string"
}
},
"required":[
"type",
"zoneId"
]
}
},
after
{
"name":"zone",
"description":"Returns metadata about a given zone",
"inputSchema":{
"type":"object",
"properties":{
"effective":{
"description":"Effective date/time",
"type":"string"
},
"type":{
"description":"Zone type (Allowed values: land, marine, forecast, public, coastal, offshore, fire, county)",
"type":"string"
},
"zoneId":{
"description":"NWS public zone/county identifier. UGC identifier for a NWS forecast zone or county.\nThe first two letters will correspond to either a state code or marine area code (see #/components/schemas/StateTerritoryCode and #/components/schemas/MarineAreaCode for lists of valid letter combinations).\nThe third letter will be Z for public/fire zone or C for county.\n",
"pattern":"^(A[KLMNRSZ]|C[AOT]|D[CE]|F[LM]|G[AMU]|I[ADLN]|K[SY]|L[ACEHMOS]|M[ADEHINOPST]|N[CDEHJMVY]|O[HKR]|P[AHKMRSWZ]|S[CDL]|T[NX]|UT|V[AIT]|W[AIVY]|[HR]I)[CZ]\\d{3}$",
"type":"string"
}
},
"required":[
"type",
"zoneId"
]
}
},
I'll submit a pr.
brant-hwang
Metadata
Metadata
Assignees
Labels
No labels