From the course: Claude with Amazon Bedrock by Anthropic

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

Prompts in the client

Prompts in the client

Our last major task is to implement some functionality inside of our MCP client and allow us to list out all the different prompts that are defined inside the MCP server and also get a particular prompt with some variables interpolated into it. So let's first implement list prompts. I will delete the comment and replace it with a result is await self session list prompts and then I will return result dot prompts and that's pretty much it. and then get prompt. Now to be clear, when we get a individual prompt, we're going to be given some number of arguments. These arguments will eventually show up inside of our prompt function. So for example, inside a format document right here, we expect to receive a document ID. Inside of this args dictionary, the expectation is that there will be a document ID key, and that will be passed in to the appropriate function over here, and then we will get that value interpolated into the prompt itself. So inside of the get prompt function, I will get a…

Contents