Skip to content

Prompt

@tsed/platform-mcp

Usage ​

typescript
import { Prompt } from "@tsed/platform-mcp";

See /packages/platform/platform-mcp/src/common/decorators/prompt.ts.

Overview ​

ts
function Prompt<Args = any>(options?: PromptDecoratorOptions<Args>): (target: any, propertyKey: string | symbol, _: PropertyDescriptor) => void;
  • options (PromptDecoratorOptions<Args>): Optional. MCP prompt metadata such as name, description, and args schema.

Description ​

Declares a Ts.ED class method as an MCP prompt and registers it through {@link definePrompt}.

Usage ​

ts
class ConciergePrompts {
  @Prompt()
  async hotelWelcome() {
    return {content: [{type: "text", text: "Welcome to Ts.ED Hotel!"}]};
  }
}

Released under the MIT License.