ExMCP.Client.Operations.Prompts (ex_mcp v0.9.2)
View SourcePrompt operations for ExMCP client.
This module handles all prompt-related operations including listing available prompts and retrieving specific prompts with their arguments.
Summary
Functions
Gets a specific prompt from the MCP server, optionally with arguments.
Lists all available prompts from the MCP server.
Functions
@spec get_prompt( ExMCP.Client.Types.client(), String.t(), map(), ExMCP.Client.Types.request_opts() ) :: ExMCP.Client.Types.mcp_response()
Gets a specific prompt from the MCP server, optionally with arguments.
Parameters
client- The client process.prompt_name- The name of the prompt to retrieve.arguments- A map of arguments to pass to the prompt.opts- A keyword list of options.
Options
:timeout- Request timeout (default: 5000):format- Response format (default: :map)
Examples
{:ok, prompt} = ExMCP.Client.Operations.Prompts.get_prompt(client, "my_prompt")
{:ok, prompt} = ExMCP.Client.Operations.Prompts.get_prompt(client, "my_prompt", %{"name" => "World"})
@spec list_prompts(ExMCP.Client.Types.client(), ExMCP.Client.Types.request_opts()) :: ExMCP.Client.Types.mcp_response()
Lists all available prompts from the MCP server.
Options
:cursor- Pagination cursor for retrieving additional results:timeout- Request timeout (default: 5000):format- Response format (default: :map)
Examples
{:ok, prompts} = ExMCP.Client.Operations.Prompts.list_prompts(client)
{:ok, prompts} = ExMCP.Client.Operations.Prompts.list_prompts(client, cursor: "page2")