Skip to main content
Version: 0.8.0

Register MCP tools

Introduced 0.7.0

Use this API to register one or more Model Context Protocol (MCP)-based tools with the Lucenia MCP server. Registered tools become available for use by agents through the MCP protocol.

Request

POST /_plugins/_ml/mcp/tools

Request body

The request body contains an array of tool definitions to register:

{
"tools": [
{
"name": "string",
"description": "string",
"parameters": {
"parameter_name": {
"type": "string",
"description": "string",
"required": boolean,
"default": "any"
}
},
"metadata": {
"category": "string",
"version": "string",
"author": "string"
}
}
]
}

Tool definition fields

FieldTypeDescriptionRequired
nameStringUnique name for the tool. Must be alphanumeric with underscores.Yes
descriptionStringHuman-readable description of the tool's functionality.Yes
parametersObjectSchema defining the tool's input parameters.No
metadataObjectAdditional metadata about the tool.No

Parameter schema fields

FieldTypeDescriptionRequired
typeStringParameter data type (string, number, boolean, object, array).Yes
descriptionStringDescription of the parameter's purpose.Yes
requiredBooleanWhether the parameter is required. Default: false.No
defaultAnyDefault value for optional parameters.No
enumArrayList of allowed values for the parameter.No

Metadata fields

FieldTypeDescription
categoryStringTool category (e.g., "search", "analysis", "utility").
versionStringTool version identifier.
authorStringTool author or organization.

Example requests

Register a single tool

POST /_plugins/_ml/mcp/tools
{
"tools": [
{
"name": "document_search",
"description": "Search through document collections using semantic similarity",
"parameters": {
"query": {
"type": "string",
"description": "Search query text",
"required": true
},
"limit": {
"type": "number",
"description": "Maximum number of results to return",
"required": false,
"default": 10
},
"index": {
"type": "string",
"description": "Index to search in",
"required": false,
"default": "default"
}
},
"metadata": {
"category": "search",
"version": "1.0.0",
"author": "Lucenia Team"
}
}
]
}

Register multiple tools

POST /_plugins/_ml/mcp/tools
{
"tools": [
{
"name": "text_analyzer",
"description": "Analyze text sentiment and extract key topics",
"parameters": {
"text": {
"type": "string",
"description": "Text to analyze",
"required": true
},
"analysis_type": {
"type": "string",
"description": "Type of analysis to perform",
"required": false,
"default": "sentiment",
"enum": ["sentiment", "topics", "entities", "all"]
}
},
"metadata": {
"category": "analysis",
"version": "2.1.0"
}
},
{
"name": "data_transformer",
"description": "Transform data from one format to another",
"parameters": {
"input_data": {
"type": "object",
"description": "Data to transform",
"required": true
},
"output_format": {
"type": "string",
"description": "Desired output format",
"required": true,
"enum": ["json", "xml", "csv", "yaml"]
},
"options": {
"type": "object",
"description": "Additional transformation options",
"required": false
}
},
"metadata": {
"category": "utility",
"version": "1.5.0"
}
}
]
}

Example response

Success response

{
"success": true,
"message": "Tools registered successfully",
"data": {
"registered_tools": [
{
"tool_id": "tool-abc123",
"name": "document_search",
"status": "active",
"registered_at": "2024-01-01T12:00:00Z"
}
],
"total_registered": 1
},
"timestamp": "2024-01-01T12:00:00Z"
}

Multiple tools response

{
"success": true,
"message": "Multiple tools registered successfully",
"data": {
"registered_tools": [
{
"tool_id": "tool-def456",
"name": "text_analyzer",
"status": "active",
"registered_at": "2024-01-01T12:00:00Z"
},
{
"tool_id": "tool-ghi789",
"name": "data_transformer",
"status": "active",
"registered_at": "2024-01-01T12:00:00Z"
}
],
"total_registered": 2
},
"timestamp": "2024-01-01T12:00:00Z"
}

Error responses

Invalid tool name

{
"success": false,
"error": {
"type": "ValidationError",
"message": "Invalid tool name",
"details": {
"field": "name",
"reason": "Tool name must contain only alphanumeric characters and underscores"
}
},
"timestamp": "2024-01-01T12:00:00Z"
}

Tool already exists

{
"success": false,
"error": {
"type": "ConflictError",
"message": "Tool with name 'document_search' already exists",
"details": {
"existing_tool_id": "tool-abc123",
"suggestion": "Use a different name or update the existing tool"
}
},
"timestamp": "2024-01-01T12:00:00Z"
}

Invalid parameter schema

{
"success": false,
"error": {
"type": "SchemaError",
"message": "Invalid parameter schema",
"details": {
"tool": "text_analyzer",
"parameter": "analysis_type",
"reason": "Enum values must be strings"
}
},
"timestamp": "2024-01-01T12:00:00Z"
}

Response fields

Success response fields

FieldTypeDescription
successBooleanIndicates successful registration.
messageStringHuman-readable success message.
data.registered_toolsArrayList of registered tool information.
data.total_registeredNumberTotal number of tools registered in this request.

Tool registration fields

FieldTypeDescription
tool_idStringUnique system-generated ID for the tool.
nameStringTool name as provided in the request.
statusStringTool status (active, inactive, error).
registered_atStringISO 8601 timestamp of registration.

Usage notes

  • Tool names must be unique across the entire MCP server
  • Tools become immediately available for use by agents after successful registration
  • Parameter schemas are validated according to JSON Schema specifications
  • Tools can be updated using the Update MCP tools API
  • The maximum number of tools that can be registered in a single request is 50