define_function
Define custom MCP functions for AI models by specifying name, description, parameters, and implementation code in supported environments like JavaScript, Python, or Shell.
Instructions
Create a new custom MCP function that the AI can use
Input Schema
Name | Required | Description | Default |
---|---|---|---|
description | Yes | Description of what the function does | |
execution_environment | No | Environment to execute the code in | javascript |
implementation_code | Yes | Code to implement the function | |
name | Yes | Name of the new function | |
parameters_schema | Yes | JSON Schema for parameters |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"description": {
"description": "Description of what the function does",
"type": "string"
},
"execution_environment": {
"default": "javascript",
"description": "Environment to execute the code in",
"enum": [
"javascript",
"python",
"shell"
],
"type": "string"
},
"implementation_code": {
"description": "Code to implement the function",
"minLength": 1,
"type": "string"
},
"name": {
"description": "Name of the new function",
"minLength": 1,
"type": "string"
},
"parameters_schema": {
"additionalProperties": {},
"description": "JSON Schema for parameters",
"type": "object"
}
},
"required": [
"name",
"description",
"parameters_schema",
"implementation_code"
],
"type": "object"
}