Registration properties
List of controllers to register as MCP tools.
typia.llm.controller<Class>(), registers all
methods of the class as toolsHttpLlm.controller(), registers all
operations from OpenAPI document as toolsOptionalpreserve?: booleanPreserve existing tools registered via McpServer.registerTool().
If true, typia tools coexist with existing McpServer tools. This uses MCP
SDK's internal (private) API which may break on SDK updates.
If false, typia tools completely replace the tool handlers, ignoring any
tools registered via McpServer.registerTool().
Target MCP server to register tools.
Both McpServer and raw Server are supported. To combine with
McpServer.registerTool(), set preserve: true.
Register MCP tools from controllers.
Registers TypeScript class methods via
typia.llm.controller<Class>()or OpenAPI operations viaHttpLlm.controller()as MCP tools.Every tool call is validated by typia. If LLM provides invalid arguments, returns IValidation.IFailure formatted by LlmJson.stringify so that LLM can correct them automatically. Below is an example of the validation error format:
If you use
McpServer.registerTool()instead, you have to define Zod schema, function name, and description string manually for each tool. Also, without typia's validation feedback, LLM cannot auto-correct its mistakes, which significantly degrades tool calling performance.