Server instructions added to IMcpClient (#17)

This commit is contained in:
Peder Holdgaard Pedersen 2025-01-24 20:36:05 +01:00 • committed by GitHub
commit 86f1edfe38
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -69,8 +69,16 @@ internal class Program
Model = AnthropicModels.Claude35Haiku,
Stream = false,
Temperature = 1.0m,
Tools = anthropicTools
Tools = anthropicTools,
System = [new SystemMessage("You will be helping the user test MCP server tool call functionality.")]
};
// If the server provides instructions, add them as the system prompt
if (!string.IsNullOrEmpty(client.ServerInstructions))
{
parameters.System.Add(new SystemMessage(client.ServerInstructions));
}
var res = await antClient.Messages.GetClaudeMessageAsync(parameters);
messages.Add(res.Message);