Skip to content

getTemplateTool

@tsed/cli

Usage

typescript
import { getTemplateTool } from "@tsed/cli/src/commands/mcp/tools/getTemplateTool";

See /packages/cli/src/commands/mcp/tools/getTemplateTool.ts.

Overview

ts
const getTemplateTool: import("@tsed/di").FactoryTokenProvider<{
    name: string | undefined;
    inputSchema: import("zod").ZodObject<import("zod/v4/core").$ZodLooseShape, import("zod/v4/core").$strip> | undefined;
    outputSchema: import("zod").ZodObject<import("zod/v4/core").$ZodLooseShape, import("zod/v4/core").$strip> | undefined;
    handler(args: import("@tsed/schema").PropsToShape<{
        id: import("@tsed/schema").JsonSchema<string>;
    }>, extra: import("@modelcontextprotocol/sdk/shared/protocol.js").RequestHandlerExtra<import("@modelcontextprotocol/sdk/types.js").ServerRequest, import("@modelcontextprotocol/sdk/types.js").ServerNotification>): Promise<{
        [x: string]: unknown;
        content: ({
            type: "text";
            text: string;
            annotations?: {
                audience?: ("user" | "assistant")[] | undefined;
                priority?: number | undefined;
                lastModified?: string | undefined;
            } | undefined;
            _meta?: {
                [x: string]: unknown;
            } | undefined;
        } | {
            type: "image";
            data: string;
            mimeType: string;
            annotations?: {
                audience?: ("user" | "assistant")[] | undefined;
                priority?: number | undefined;
                lastModified?: string | undefined;
            } | undefined;
            _meta?: {
                [x: string]: unknown;
            } | undefined;
        } | {
            type: "audio";
            data: string;
            mimeType: string;
            annotations?: {
                audience?: ("user" | "assistant")[] | undefined;
                priority?: number | undefined;
                lastModified?: string | undefined;
            } | undefined;
            _meta?: {
                [x: string]: unknown;
            } | undefined;
        } | {
            uri: string;
            name: string;
            type: "resource_link";
            description?: string | undefined;
            mimeType?: string | undefined;
            annotations?: {
                audience?: ("user" | "assistant")[] | undefined;
                priority?: number | undefined;
                lastModified?: string | undefined;
            } | undefined;
            _meta?: {
                [x: string]: unknown;
            } | undefined;
            icons?: {
                src: string;
                mimeType?: string | undefined;
                sizes?: string[] | undefined;
                theme?: "light" | "dark" | undefined;
            }[] | undefined;
            title?: string | undefined;
        } | {
            type: "resource";
            resource: {
                uri: string;
                text: string;
                mimeType?: string | undefined;
                _meta?: {
                    [x: string]: unknown;
                } | undefined;
            } | {
                uri: string;
                blob: string;
                mimeType?: string | undefined;
                _meta?: {
                    [x: string]: unknown;
                } | undefined;
            };
            annotations?: {
                audience?: ("user" | "assistant")[] | undefined;
                priority?: number | undefined;
                lastModified?: string | undefined;
            } | undefined;
            _meta?: {
                [x: string]: unknown;
            } | undefined;
        })[];
        _meta?: {
            [x: string]: unknown;
            progressToken?: string | number | undefined;
            "io.modelcontextprotocol/related-task"?: {
                taskId: string;
            } | undefined;
        } | undefined;
        structuredContent?: {
            [x: string]: unknown;
        } | undefined;
        isError?: boolean | undefined;
    } | {
        content: never[];
        structuredContent: {
            code: string;
            message: any;
        };
    }>;
    description?: string | undefined;
    _meta?: Record<string, unknown> | undefined;
    annotations?: import("@modelcontextprotocol/sdk/types.js").ToolAnnotations;
    title?: string | undefined;
} | {
    name: string | undefined;
    inputSchema: import("zod").ZodObject<import("zod/v4/core").$ZodLooseShape, import("zod/v4/core").$strip> | undefined;
    outputSchema: import("zod").ZodObject<import("zod/v4/core").$ZodLooseShape, import("zod/v4/core").$strip> | undefined;
    handler(args: import("@tsed/schema").PropsToShape<{
        id: import("@tsed/schema").JsonSchema<string>;
    }>, extra: import("@modelcontextprotocol/sdk/shared/protocol.js").RequestHandlerExtra<import("@modelcontextprotocol/sdk/types.js").ServerRequest, import("@modelcontextprotocol/sdk/types.js").ServerNotification>): Promise<{
        [x: string]: unknown;
        content: ({
            type: "text";
            text: string;
            annotations?: {
                audience?: ("user" | "assistant")[] | undefined;
                priority?: number | undefined;
                lastModified?: string | undefined;
            } | undefined;
            _meta?: {
                [x: string]: unknown;
            } | undefined;
        } | {
            type: "image";
            data: string;
            mimeType: string;
            annotations?: {
                audience?: ("user" | "assistant")[] | undefined;
                priority?: number | undefined;
                lastModified?: string | undefined;
            } | undefined;
            _meta?: {
                [x: string]: unknown;
            } | undefined;
        } | {
            type: "audio";
            data: string;
            mimeType: string;
            annotations?: {
                audience?: ("user" | "assistant")[] | undefined;
                priority?: number | undefined;
                lastModified?: string | undefined;
            } | undefined;
            _meta?: {
                [x: string]: unknown;
            } | undefined;
        } | {
            uri: string;
            name: string;
            type: "resource_link";
            description?: string | undefined;
            mimeType?: string | undefined;
            annotations?: {
                audience?: ("user" | "assistant")[] | undefined;
                priority?: number | undefined;
                lastModified?: string | undefined;
            } | undefined;
            _meta?: {
                [x: string]: unknown;
            } | undefined;
            icons?: {
                src: string;
                mimeType?: string | undefined;
                sizes?: string[] | undefined;
                theme?: "light" | "dark" | undefined;
            }[] | undefined;
            title?: string | undefined;
        } | {
            type: "resource";
            resource: {
                uri: string;
                text: string;
                mimeType?: string | undefined;
                _meta?: {
                    [x: string]: unknown;
                } | undefined;
            } | {
                uri: string;
                blob: string;
                mimeType?: string | undefined;
                _meta?: {
                    [x: string]: unknown;
                } | undefined;
            };
            annotations?: {
                audience?: ("user" | "assistant")[] | undefined;
                priority?: number | undefined;
                lastModified?: string | undefined;
            } | undefined;
            _meta?: {
                [x: string]: unknown;
            } | undefined;
        })[];
        _meta?: {
            [x: string]: unknown;
            progressToken?: string | number | undefined;
            "io.modelcontextprotocol/related-task"?: {
                taskId: string;
            } | undefined;
        } | undefined;
        structuredContent?: {
            [x: string]: unknown;
        } | undefined;
        isError?: boolean | undefined;
    } | {
        content: never[];
        structuredContent: {
            code: string;
            message: any;
        };
    }>;
    description?: string | undefined;
    _meta?: Record<string, unknown> | undefined;
    annotations?: import("@modelcontextprotocol/sdk/types.js").ToolAnnotations;
    title?: string | undefined;
    token: import("@tsed/core").Type | import("@tsed/core").AbstractType<any>;
    propertyKey: string | symbol;
}>;

name

ts
name: string | undefined;

inputSchema: import

ts
inputSchema: import("zod").ZodObject<import("zod/v4/core").$ZodLooseShape, import("zod/v4/core").$strip> | undefined;

outputSchema: import

ts
outputSchema: import("zod").ZodObject<import("zod/v4/core").$ZodLooseShape, import("zod/v4/core").$strip> | undefined;

handler

ts
handler(args: import("@tsed/schema").PropsToShape<{
     id: import("@tsed/schema").JsonSchema<string>;
 }>, extra: import("@modelcontextprotocol/sdk/shared/protocol.js").RequestHandlerExtra<import("@modelcontextprotocol/sdk/types.js").ServerRequest, import("@modelcontextprotocol/sdk/types.js").ServerNotification>): Promise<{
     [x: string]: unknown;
     content: ({
         type: "text";
         text: string;
         annotations?: {
             audience?: ("user" | "assistant")[] | undefined;
             priority?: number | undefined;
             lastModified?: string | undefined;
         } | undefined;
         _meta?: {
             [x: string]: unknown;
         } | undefined;
     } | {
         type: "image";
         data: string;
         mimeType: string;
         annotations?: {
             audience?: ("user" | "assistant")[] | undefined;
             priority?: number | undefined;
             lastModified?: string | undefined;
         } | undefined;
         _meta?: {
             [x: string]: unknown;
         } | undefined;
     } | {
         type: "audio";
         data: string;
         mimeType: string;
         annotations?: {
             audience?: ("user" | "assistant")[] | undefined;
             priority?: number | undefined;
             lastModified?: string | undefined;
         } | undefined;
         _meta?: {
             [x: string]: unknown;
         } | undefined;
     } | {
         uri: string;
         name: string;
         type: "resource_link";
         description?: string | undefined;
         mimeType?: string | undefined;
         annotations?: {
             audience?: ("user" | "assistant")[] | undefined;
             priority?: number | undefined;
             lastModified?: string | undefined;
         } | undefined;
         _meta?: {
             [x: string]: unknown;
         } | undefined;
         icons?: {
             src: string;
             mimeType?: string | undefined;
             sizes?: string[] | undefined;
             theme?: "light" | "dark" | undefined;
         }[] | undefined;
         title?: string | undefined;
     } | {
         type: "resource";
         resource: {
             uri: string;
             text: string;
             mimeType?: string | undefined;
             _meta?: {
                 [x: string]: unknown;
             } | undefined;
         } | {
             uri: string;
             blob: string;
             mimeType?: string | undefined;
             _meta?: {
                 [x: string]: unknown;
             } | undefined;
         };
         annotations?: {
             audience?: ("user" | "assistant")[] | undefined;
             priority?: number | undefined;
             lastModified?: string | undefined;
         } | undefined;
         _meta?: {
             [x: string]: unknown;
         } | undefined;
     })[];
     _meta?: {
         [x: string]: unknown;
         progressToken?: string | number | undefined;
         "io.modelcontextprotocol/related-task"?: {
             taskId: string;
         } | undefined;
     } | undefined;
     structuredContent?: {
         [x: string]: unknown;
     } | undefined;
     isError?: boolean | undefined;
 } | {
     content: never[];
     structuredContent: {
         code: string;
         message: any;
     };
 }>;

description

ts
description?: string | undefined;

_meta

ts
_meta?: Record<string, unknown> | undefined;

annotations: import

ts
annotations?: import("@modelcontextprotocol/sdk/types.js").ToolAnnotations;

title

ts
title?: string | undefined;

ts
} | {

name

ts
name: string | undefined;

inputSchema: import

ts
inputSchema: import("zod").ZodObject<import("zod/v4/core").$ZodLooseShape, import("zod/v4/core").$strip> | undefined;

outputSchema: import

ts
outputSchema: import("zod").ZodObject<import("zod/v4/core").$ZodLooseShape, import("zod/v4/core").$strip> | undefined;

handler

ts
handler(args: import("@tsed/schema").PropsToShape<{
     id: import("@tsed/schema").JsonSchema<string>;
 }>, extra: import("@modelcontextprotocol/sdk/shared/protocol.js").RequestHandlerExtra<import("@modelcontextprotocol/sdk/types.js").ServerRequest, import("@modelcontextprotocol/sdk/types.js").ServerNotification>): Promise<{
     [x: string]: unknown;
     content: ({
         type: "text";
         text: string;
         annotations?: {
             audience?: ("user" | "assistant")[] | undefined;
             priority?: number | undefined;
             lastModified?: string | undefined;
         } | undefined;
         _meta?: {
             [x: string]: unknown;
         } | undefined;
     } | {
         type: "image";
         data: string;
         mimeType: string;
         annotations?: {
             audience?: ("user" | "assistant")[] | undefined;
             priority?: number | undefined;
             lastModified?: string | undefined;
         } | undefined;
         _meta?: {
             [x: string]: unknown;
         } | undefined;
     } | {
         type: "audio";
         data: string;
         mimeType: string;
         annotations?: {
             audience?: ("user" | "assistant")[] | undefined;
             priority?: number | undefined;
             lastModified?: string | undefined;
         } | undefined;
         _meta?: {
             [x: string]: unknown;
         } | undefined;
     } | {
         uri: string;
         name: string;
         type: "resource_link";
         description?: string | undefined;
         mimeType?: string | undefined;
         annotations?: {
             audience?: ("user" | "assistant")[] | undefined;
             priority?: number | undefined;
             lastModified?: string | undefined;
         } | undefined;
         _meta?: {
             [x: string]: unknown;
         } | undefined;
         icons?: {
             src: string;
             mimeType?: string | undefined;
             sizes?: string[] | undefined;
             theme?: "light" | "dark" | undefined;
         }[] | undefined;
         title?: string | undefined;
     } | {
         type: "resource";
         resource: {
             uri: string;
             text: string;
             mimeType?: string | undefined;
             _meta?: {
                 [x: string]: unknown;
             } | undefined;
         } | {
             uri: string;
             blob: string;
             mimeType?: string | undefined;
             _meta?: {
                 [x: string]: unknown;
             } | undefined;
         };
         annotations?: {
             audience?: ("user" | "assistant")[] | undefined;
             priority?: number | undefined;
             lastModified?: string | undefined;
         } | undefined;
         _meta?: {
             [x: string]: unknown;
         } | undefined;
     })[];
     _meta?: {
         [x: string]: unknown;
         progressToken?: string | number | undefined;
         "io.modelcontextprotocol/related-task"?: {
             taskId: string;
         } | undefined;
     } | undefined;
     structuredContent?: {
         [x: string]: unknown;
     } | undefined;
     isError?: boolean | undefined;
 } | {
     content: never[];
     structuredContent: {
         code: string;
         message: any;
     };
 }>;

description

ts
description?: string | undefined;

_meta

ts
_meta?: Record<string, unknown> | undefined;

annotations: import

ts
annotations?: import("@modelcontextprotocol/sdk/types.js").ToolAnnotations;

title

ts
title?: string | undefined;

token: import

ts
token: import("@tsed/core").Type | import("@tsed/core").AbstractType<any>;

propertyKey

ts
propertyKey: string | symbol;

Released under the MIT License.