import { BaseMCPRoute, MCPOAuthMode } from "./decorator.js"; import { RequestHandler } from "express"; import { TsoaRoute } from "@tsoa/runtime"; //#region src/lib/registry.d.ts /** * A single route entry from the generated tsoaRouteRegistry */ interface TsoaRouteEntry { controllerName: string; methodName: string; method: string; path: string; security: TsoaRoute.Security[]; args: Record; getMiddlewares: () => RequestHandler[]; /** Standard Express invoke (used by RegisterRoutes) */ invoke: (request: any, response: any, next: any) => Promise; /** Direct invoke — calls the controller method and returns the result, no res/next needed */ invokeDirect: (request: any) => Promise; controllerClass: new (...args: any[]) => any; } /** * A resolved MCP tool derived from a TSOA route entry + MCPRoute class */ interface McpToolEntry { /** Tool name (from @MCPRoute) */ name: string; /** Tool description (from @MCPRoute) */ description: string; /** Controller class name */ controllerName: string; /** Controller method name */ methodName: string; /** HTTP method */ method: string; /** Route path */ path: string; /** TSOA parameter schema for building the input JSON schema */ args: Record; /** Security requirements */ security: TsoaRoute.Security[]; /** Get the middleware chain for this route */ getMiddlewares: () => RequestHandler[]; /** Invoke the controller method with validated args */ invoke: TsoaRouteEntry['invoke']; /** Direct invoke — returns the controller result directly */ invokeDirect: TsoaRouteEntry['invokeDirect']; /** The instantiated MCPRoute resolver */ resolver: BaseMCPRoute; /** OAuth mode: 'required' = hidden without OAuth, 'optional' = cookie params exposed, false = no OAuth */ oauth: MCPOAuthMode; } /** * Filters a tsoaRouteRegistry down to only entries decorated with @Tool, * instantiates their MCPRoute classes, and resolves metadata. */ declare function resolveTools(registry: TsoaRouteEntry[]): McpToolEntry[]; /** * Build a JSON Schema "properties" object from TSOA parameter definitions. * Used to define the MCP tool's inputSchema. */ declare function buildInputSchema(args: Record, options?: { includeHeaders?: boolean; }): { type: 'object'; properties: Record; required: string[]; }; //#endregion export { McpToolEntry, TsoaRouteEntry, buildInputSchema, resolveTools }; //# sourceMappingURL=registry.d.ts.map