What are parameters?
Parameters are the inputs your tool receives from the AI. When the AI decides to call your tool, it constructs a JSON payload matching your parameter schema. MCPCore validates this payload before your code runs. Your code accesses parameters through theparams object:
Adding parameters
In the tool editor, click Add parameter for each input your code needs.
Parameter fields
| Field | Required | Description |
|---|---|---|
| Name | Yes | The key used to access the value in params.*. Use camelCase. |
| Type | Yes | The expected data type (see types below). |
| Description | Yes | What the parameter represents. The AI uses this to know what value to pass. |
| Required | — | If checked, the AI must always provide this parameter. |
| Default value | — | Used when the parameter is not required and the AI doesn’t provide it. |
Supported types
string
A plain text value.
number
An integer or floating-point number.
boolean
true or false.
array
A JSON array. Use the Items type field to specify the type of each element.
object
A JSON object with sub-properties. Define each sub-property with its own type and description.
Best practices for parameter descriptions
The AI reads the parameter description to understand what value to pass. Good descriptions reduce tool call errors.| Parameter | Weak description | Strong description |
|---|---|---|
repo | ”The repo" | "GitHub repository in owner/repo format, e.g. torvalds/linux” |
since | ”Start date" | "ISO 8601 date string. Filters results to records created after this date, e.g. 2024-01-01” |
limit | ”How many" | "Maximum number of results to return. Min 1, max 100. Defaults to 20.” |
Parameter validation
MCPCore validates every tool call against your parameter schema before running the code. If validation fails:- Missing required parameters →
400error returned to the AI - Wrong type →
400error with a clear message - Your code is never executed
Optional parameters
For optional parameters, always provide a sensible default value or handle theundefined case in code: