ExMCP.Client.Operations.Prompts (ex_mcp v0.9.2)

View Source

Prompt 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

get_prompt(client, prompt_name, arguments \\ %{}, opts \\ [])

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"})

list_prompts(client, opts \\ [])

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")