Prompt Completion

Prompt Completion
๐Ÿ‘จโ€๐Ÿ’ผ As the user searches through the dynamic values it can input for the prompt, it would be nice to have auto-completion of values.
We'll use the completable function to create a completable prompt.
import { completable } from '@modelcontextprotocol/sdk/server/completable.js'

// ...

agent.server.registerPrompt(
	'say_hello',
	{
		title: 'Say hello to the user',
		description: 'Say hello to the user',
		argsSchema: {
		name: completable(
			z.string().describe('The name of the user to say hello to'),
			async (value) => {
				const users = await agent.db.getUsers()
				return users
					.map((user) => user.name)
					.filter((name) => name.includes(value))
			},
		),
	},
	async ({ name }) => {
		// ... return prompt messages
	},
)

Please set the playground first

Loading "Prompt Completion"
Loading "Prompt Completion"

Access Denied

You must login or register for the workshop to view the diff.

Check out this video to see how the diff tab works.

Epic Workshop Diff Tab Demo