@nestia/sdk
Version:
Nestia SDK and Swagger generator
31 lines • 1.38 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.TypedMcpRouteAnalyzer = void 0;
var TypedMcpRouteAnalyzer;
(function (TypedMcpRouteAnalyzer) {
TypedMcpRouteAnalyzer.analyze = (props) => { var _a; return [
{
protocol: "mcp",
controller: props.controller,
name: props.operation.name,
toolName: props.operation.toolName,
title: props.operation.title,
toolDescription: props.operation.toolDescription,
accessor: accessor(props.operation.toolName),
function: props.operation.function,
input: (_a = props.operation.parameters[0]) !== null && _a !== void 0 ? _a : null,
returnType: props.operation.returnType,
inputSchema: props.operation.inputSchema,
outputSchema: props.operation.outputSchema,
annotations: props.operation.annotations,
imports: props.operation.imports,
description: props.operation.description,
jsDocTags: props.operation.jsDocTags,
},
]; };
const accessor = (toolName) => {
const safe = toolName.replace(/[^A-Za-z0-9_$]/g, "_");
return ["mcp", safe];
};
})(TypedMcpRouteAnalyzer || (exports.TypedMcpRouteAnalyzer = TypedMcpRouteAnalyzer = {}));
//# sourceMappingURL=TypedMcpRouteAnalyzer.js.map