| Did you know ... | Search Documentation: |
| Pack logtalk -- logtalk-3.98.0/docs/apis/_sources/mcp_prompt_protocol_0.rst.txt |
.. index:: single: mcp_prompt_protocol .. _mcp_prompt_protocol/0:
.. rst-class:: right
protocol
mcp_prompt_protocolProtocol for Logtalk objects that provide prompts to be exposed via an MCP (Model Context Protocol) server. Implements the MCP 2025-06-18 specification. Implementing objects must define the set of prompts available and handle prompt get requests. Prompts are templates for structured LLM interactions that can accept arguments to customize their behavior.
| Availability:
| logtalk_load(mcp_server(loader))
| Author: Paulo Moura | Version: 0:2:0 | Date: 2026-02-24
| Compilation flags:
| static
| Dependencies: | (none)
| Remarks:
prompts in their capabilities/1 predicate (from the mcp_tool_protocol protocol). The server will then advertise the prompts capability and handle prompts/list and prompts/get requests.prompt(Name, Description, Arguments) or prompt(Name, Title, Description, Arguments) term where Name is an atom, Title is an optional human-friendly display name (an atom), Description is a human-readable atom, and Arguments is a list of argument(ArgName, ArgDescription, Required) terms.message(Role, Content) term where Role is user or assistant and Content is text(Text) where Text is an atom.| Inherited public predicates: | (none)
.. contents:: :local: :backlinks: top
.. index:: prompts/1 .. _mcp_prompt_protocol/0::prompts/1:
prompts/1 ^^^^^^^^^^^^^
Returns a list of prompt descriptors available from this object. Each descriptor is a compound term prompt(Name, Description, Arguments) or prompt(Name, Title, Description, Arguments) where Name is the MCP prompt name (an atom), Title is an optional human-friendly display name (an atom), Description is a human-readable description (an atom), and Arguments is a list of argument(ArgName, ArgDescription, Required) terms describing the prompt arguments. ArgName and ArgDescription are atoms, and Required is the boolean true or false.
| Compilation flags:
| static
| Template:
| prompts(Prompts)
| Mode and number of proofs:
| prompts(-list(compound)) - one
.. index:: prompt_get/3 .. _mcp_prompt_protocol/0::prompt_get/3:
prompt_get/3 ^^^^^^^^^^^^^^^^
Handles a prompt get request. Name is the MCP prompt name (as declared in prompts/1), Arguments is a list of ArgumentName-Value pairs provided by the client, and Result is unified with the prompt result. The result must be one of: messages(MessageList) for a list of prompt messages, or messages(Description, MessageList) to also include a description. Each message in the list must be a message(Role, Content) term where Role is user or assistant and Content is text(Text) where Text is an atom.
| Compilation flags:
| static
| Template:
| prompt_get(Name,Arguments,Result)
| Mode and number of proofs:
| prompt_get(+atom,+list(pair),--compound) - one
(none)
(none)
(none)