Controller of TypeScript class-based LLM function calling.
ILlmController is a controller for registering TypeScript class methods as LLM function calling tools. It contains ILlmApplication with function calling schemas, identifier, and class instance for method execution.
ILlmController
You can create this controller with typia.llm.controller<Class>() function, and register it to MCP server with registerMcpControllers:
typia.llm.controller<Class>()
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";import { registerMcpControllers } from "@typia/mcp";import typia from "typia";class Calculator { add(input: { a: number; b: number }): number { return input.a + input.b; } subtract(input: { a: number; b: number }): number { return input.a - input.b; }}const server = new McpServer({ name: "my-server", version: "1.0.0" });registerMcpControllers({ server, controllers: [ typia.llm.controller<Calculator>("calculator", new Calculator()), ],}); Copy
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";import { registerMcpControllers } from "@typia/mcp";import typia from "typia";class Calculator { add(input: { a: number; b: number }): number { return input.a + input.b; } subtract(input: { a: number; b: number }): number { return input.a - input.b; }}const server = new McpServer({ name: "my-server", version: "1.0.0" });registerMcpControllers({ server, controllers: [ typia.llm.controller<Calculator>("calculator", new Calculator()), ],});
For OpenAPI/HTTP-based controller, use IHttpLlmController instead.
Jeongho Nam - https://github.com/samchon
Class type of the function executor
Application schema of function calling.
Target class instance for function execution.
Identifier name of the controller.
Protocol discriminator.
Controller of TypeScript class-based LLM function calling.
ILlmControlleris a controller for registering TypeScript class methods as LLM function calling tools. It contains ILlmApplication with function calling schemas, identifier, and class instance for method execution.You can create this controller with
typia.llm.controller<Class>()function, and register it to MCP server with registerMcpControllers:For OpenAPI/HTTP-based controller, use IHttpLlmController instead.
Author
Jeongho Nam - https://github.com/samchon