Property InputSchema
InputSchema
Gets the JSON Schema defining the expected input arguments.
public string InputSchema { get; }
Property Value
- string
A JSON Schema (Draft-07 subset) string describing the arguments object structure.
Examples
Example: Well-structured input schema
public string InputSchema => """
{
"type": "object",
"properties": {
"query": {
"type": "string",
"description": "Search query text"
},
"maxResults": {
"type": "integer",
"minimum": 1,
"maximum": 100,
"default": 10,
"description": "Maximum number of results to return"
},
"sortBy": {
"type": "string",
"enum": ["relevance", "date", "popularity"],
"default": "relevance",
"description": "How to sort the results"
}
},
"required": ["query"]
}
""";
Remarks
The schema tells the model exactly what arguments the tool expects. A well-designed schema significantly improves the model's ability to call the tool correctly.
Schema Best Practices:
- Always set
"type": "object"at the root - Define
propertieswith explicit types (string, number, boolean, array, object) - List required parameters in the
requiredarray - Use
enumfor parameters with fixed valid values - Provide
descriptionfor each property - Set
defaultvalues where appropriate - Avoid deeply nested structures