AI Routing
ColdBox provides first-class AI routing via toAi() and toMCP(), enabling automatic registration of AI inference and Model Context Protocol endpoints.
toAi()
Overview
route( "/api/assistant" ).toAi( "models.AssistantAgent" );HTTP Verb
Pattern
Handler Action
Purpose
Arguments
route( pattern ).toAi( target, [name] )Argument
Type
Description
Basic Example
Modifier Inheritance
Invoke Endpoint
Stream Endpoint
Batch Endpoint
Info Endpoint
IAiRunnable Interface
toMCP()
Overview
Arguments
Argument
Type
Description
Static Server
Dynamic Server (Recommended)
Modifier Inheritance
MCP Server Registration
Using Both Together
Last updated
Was this helpful?