| 1 | import { SetMetadata } from '@nestjs/common' |
| 2 | import { ZodObject, ZodOptional, ZodType } from 'zod' |
| 3 | import { MCP_PROMPT_METADATA_KEY } from './constants' |
| 4 | |
| 5 | interface PromptArgsRawShape { |
| 6 | [k: string]: |
| 7 | | ZodType |
| 8 | | ZodOptional<ZodType> |
| 9 | } |
| 10 | |
| 11 | export interface PromptMetadata { |
| 12 | name: string |
| 13 | description: string |
| 14 | parameters?: ZodObject<PromptArgsRawShape> |
| 15 | } |
| 16 | |
| 17 | export interface PromptOptions { |
| 18 | name?: string |
| 19 | description: string |
| 20 | parameters?: ZodObject<PromptArgsRawShape> |
| 21 | } |
| 22 | |
| 23 | export function Prompt(options: PromptOptions) { |
| 24 | return SetMetadata(MCP_PROMPT_METADATA_KEY, options) |
| 25 | } |
| 26 |