weather.prompt.ts•897 B
import { Injectable, Scope } from '@nestjs/common';
import { Prompt } from '@rekog/mcp-nest';
import { z } from 'zod';
@Injectable({ scope: Scope.REQUEST })
export class WeatherPrompt {
@Prompt({
name: 'weather-guide',
description: 'Simple instruction for providing weather updates',
parameters: z.object({
location: z.string().describe('The location to get weather updates for'),
unit: z.string().describe('The unit of measurement for the temperature').default('Celsius'),
}),
})
getWeatherInstructions({ location, unit }: { location: string; unit: string }) {
return {
description: 'Provide weather updates for a specific location!',
messages: [
{
role: 'user',
content: {
type: 'text',
text: `Provide weather updates for ${location} in ${unit}`,
},
},
],
};
}
}