Interface IMCPSchema

Interface for the MCP schema, defining the structure and behavior of an MCP.

interface IMCPSchema {
    callbacks?: Partial<IMCPCallbacks>;
    callTool: <T extends { [x: string]: unknown } = { [x: string]: unknown }>(
        toolName: string,
        dto: IMCPToolCallDto<T>,
    ) => Promise<MCPToolOutput>;
    docDescription?: string;
    listTools: (clientId: string) => Promise<IMCPTool<unknown>[]>;
    mcpName: string;
}

Properties

callbacks?: Partial<IMCPCallbacks>

Optional callbacks for MCP lifecycle events.

callTool: <T extends { [x: string]: unknown } = { [x: string]: unknown }>(
    toolName: string,
    dto: IMCPToolCallDto<T>,
) => Promise<MCPToolOutput>

Function to call a specific tool with the provided parameters.

Type declaration

    • <T extends { [x: string]: unknown } = { [x: string]: unknown }>(
          toolName: string,
          dto: IMCPToolCallDto<T>,
      ): Promise<MCPToolOutput>
    • Type Parameters

      • T extends { [x: string]: unknown } = { [x: string]: unknown }

      Parameters

      • toolName: string

        The name of the tool to call.

      • dto: IMCPToolCallDto<T>

        The data transfer object containing tool call parameters.

      Returns Promise<MCPToolOutput>

      A promise resolving when the tool call is complete.

docDescription?: string

Optional description of the MCP for documentation.

listTools: (clientId: string) => Promise<IMCPTool<unknown>[]>

Function to list available tools for a client.

Type declaration

    • (clientId: string): Promise<IMCPTool<unknown>[]>
    • Parameters

      • clientId: string

        The ID of the client.

      Returns Promise<IMCPTool<unknown>[]>

      A promise resolving to an array of IMCPTool objects.

mcpName: string

Unique name of the MCP.