Documentation
    Preparing search index...

    Interface ILlmController<Class>

    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.

    You can create this controller with typia.llm.controller<Class>() function, and register it to MCP server with registerMcpControllers:

    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

    interface ILlmController<Class extends object = any> {
        application: ILlmApplication<Class>;
        execute: Class;
        name: string;
        protocol: "class";
    }

    Type Parameters

    • Class extends object = any

      Class type of the function executor

    Index

    Properties

    application: ILlmApplication<Class>

    Application schema of function calling.

    execute: Class

    Target class instance for function execution.

    name: string

    Identifier name of the controller.

    protocol: "class"

    Protocol discriminator.