Did you know ... Search Documentation:
Pack mcp -- prolog/mcp/tools.pl
PublicShow source

Builds the tools/list response from the global tool registry and dispatches tools/call to the registered handler in its declaring module.

Handler contract:

Handler(+Args:dict, -Content)

If the call raises an exception the result is reported back with isError:true so the LLM can recover, rather than as a JSON-RPC error. Schema-validation failures use the JSON-RPC `Invalid params` error code -32602 because they indicate a client-side mistake.

 list_tools(-Tools:list) is det
 call_tool(+Params, -Result) is det
Params is #{name:Name, arguments:Args}.