Add resources and prompts
Add a project review prompt
Register a reusable prompt that turns one validated topic into a clear review request without performing the review itself.
8 minute lesson
A prompt packages a reusable conversation starter. It does not execute a workflow by itself.
Add the prompt below the resource:
server.registerPrompt(
'review_project',
{
title: 'Review project notes',
description: 'Review project notes about one topic',
argsSchema: z.object({
topic: z.string().min(1).describe('Topic to review')
})
},
({ topic }) => ({
messages: [{
role: 'user' as const,
content: {
type: 'text' as const,
text: `Search the project notes for "${topic}". Summarize the evidence, identify missing information, and suggest one next action.`
}
}]
})
)
The argument schema rejects an empty topic before rendering. The callback returns a user message containing that validated value.
Notice the boundary: this prompt does not call search_notes, read a resource, or perform the review. The host decides whether to render it, which model receives it, and which tools that model may use.
Avoid putting secrets, hidden policy, or unreviewed remote text into a prompt registration. Prompts are discoverable server content, not a private control channel.
List and render it in the Inspector with deploy as the topic.
Then render it with an empty topic and a topic containing quotation marks. Confirm validation works and the topic remains ordinary message text. Later, the host must still treat any note content it retrieves as untrusted data.
Lesson completed