getPrompt method
Resolves a prompt through the active MCP session.
Implementation
Future<McpJsonMap> getPrompt(
String name, {
Object? id,
Map<String, String> arguments = const <String, String>{},
bool streamable = true,
bool directJson = false,
String? protocolVersion,
Map<String, String> headers = const <String, String>{},
}) async {
final promptName = _validatedMcpPromptName(name, 'name');
final response = await request(
'prompts/get',
id: id,
params: <String, Object?>{'name': promptName, 'arguments': arguments},
streamable: directJson ? false : streamable,
includeSession: !directJson,
protocolVersion: protocolVersion,
headers: headers,
);
return _validatedPromptGetResult(
_jsonRpcResultFrom(response, method: 'prompts/get'),
label: 'prompts/get result',
);
}