Skip to main content

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 the params object:

Adding parameters

In the tool editor, click Add parameter for each input your code needs.

Parameter fields


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 validation

MCPCore validates every tool call against your parameter schema before running the code. If validation fails:
  • Missing required parameters → 400 error returned to the AI
  • Wrong type → 400 error with a clear message
  • Your code is never executed
This means you do not need to validate required parameters in your code — they are guaranteed to be present and of the correct type when your code runs.

Optional parameters

For optional parameters, always provide a sensible default value or handle the undefined case in code:

Working with objects

Object parameters are ideal for grouping related inputs:

Working with arrays