Advanced examples
JSON Schema for tool arguments
JSON Schema for tool arguments
Configure JSON Schema for tool arguments for your Rapid MCP server
Use this if you want to specify more complex JSON Schema for tool arguments for the model.
Specification
Tool arguments object has two kinds:
- Easy/simple way: Implied type from key/value
- Advanced way: Explicit JSON Schema definition See JSON Schema
{
// Directly specify key/value type for the tool argument (Easy/simple way)
"myValue": "my test value", // inferred as a string
// JSON Schema (Advanced way)
"myValue": {
// Specify the JSON Schema variable here in an object format
"type": "string", // string, number, boolean, array, object, integer
"enum": ["home", "work", "other"],
// ... Specify any JSON SCHEMA properties here... (see below for examples)
},
}Below are JSON Schema examples you can place under tool arguments..
String enum
{
// ...
"myEnum": {
"type": "string",
"enum": ["home", "work", "other"],
}
}String with min/max length
{
// ...
"myString": {
"type": "string",
"minLength": 3,
"maxLength": 30,
}
}Number with min/max
{
// ...
"myNumber": {
"type": "number",
"minimum": -90,
"maximum": 90,
}
}Integer with min
{
// ...
"myInteger": {
"type": "integer",
"minimum": 1,
}
}Boolean
{
// ...
"myBoolean": {
"type": "boolean",
"default": true,
}
}Array of strings
{
// ...
"myArray": {
"type": "array",
"items": {
"type": "string",
},
}
}Array of enum strings with length limits
{
// ...
"myArray": {
"type": "array",
"items": {
"type": "string",
"enum": ["a", "b", "c"],
},
"minItems": 1,
"maxItems": 5,
}
} Object with required fields
{
// ...
"myObject": {
"type": "object",
"properties": {
"name": { "type": "string", "minLength": 1 },
"age": { "type": "integer", "minimum": 0 }
},
"required": ["name"]
}
}Array of objects (with nested constraints)
{
// ...
"myArray": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": { "type": "string" },
"qty": { "type": "integer", "minimum": 1 }
},
"required": ["id", "qty"]
},
"minItems": 1
}
}Union via oneOf / anyOf
{
// ...
"myUnion": {
"oneOf": [ { "type": "string" }, { "type": "number" } ]
}
}Full inputSchema example
{
// ...
"myInputSchema": {
"type": "object",
"properties": {
"myEnum": { "type": "string", "enum": ["home", "work", "other"] },
"latitude": { "type": "number", "minimum": -90, "maximum": 90 },
"longitude": { "type": "number", "minimum": -180, "maximum": 180 },
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": { "type": "string" },
"qty": { "type": "integer", "minimum": 1 }
},
"required": ["id", "qty"]
},
"minItems": 1
}
}
}
}Defaults
- The current converter validates types and constraints but does not apply default values to missing inputs.
- If you include a
defaultfield in your JSON schema nodes, it will be ignored by validation (no runtime filling - yet).