You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mcp.WithDescription("Set the current context to a specific StreamNative Cloud cluster, once you set the context, you can use pulsar and kafka tools to interact with the cluster. If you encounter ContextNotSetErr, please use `streamnative_cloud_context_available_clusters` to list the available clusters and set the context to a specific cluster."),
mcp.WithDescription("Set the current context to a specific StreamNative Cloud cluster, once you set the context, you can use pulsar and kafka tools to interact with the cluster. If you encounter ContextNotSetErr, please use `sncloud_context_available_clusters` to list the available clusters and set the context to a specific cluster."),
46
46
mcp.WithString("instanceName", mcp.Required(),
47
47
mcp.Description("The name of the pulsar instance to use"),
48
48
),
@@ -53,8 +53,8 @@ func RegisterContextTools(s *server.MCPServer, features []string) {
mcp.WithDescription("Display the available pulsar clusters for the current organization on StreamNative Cloud. You can use `streamnative_cloud_context_use_cluster` to change the context to a specific cluster. You will need to ask for the USER to confirm the target context cluster if there are multiple clusters."),
mcp.WithDescription("Display the available pulsar clusters for the current organization on StreamNative Cloud. You can use `sncloud_context_use_cluster` to change the context to a specific cluster. You will need to ask for the USER to confirm the target context cluster if there are multiple clusters."),
mcp.WithPromptDescription("Read a Pulsar cluster in the StreamNative Cloud"),
37
-
mcp.WithArgument("name", mcp.RequiredArgument(), mcp.ArgumentDescription("The name of the Pulsar cluster")),
68
+
s.AddPrompt(mcp.NewPrompt("read-sncloud-cluster",
69
+
mcp.WithPromptDescription("Read a cluster from the StreamNative Cloud"),
70
+
mcp.WithArgument("name", mcp.RequiredArgument(), mcp.ArgumentDescription("The name of the cluster")),
38
71
), handleReadPulsarCluster)
72
+
s.AddPrompt(
73
+
mcp.NewPrompt("build-sncloud-serverless-cluster",
74
+
mcp.WithPromptDescription("Build a Serverless cluster in the StreamNative Cloud"),
75
+
mcp.WithArgument("instance-name", mcp.RequiredArgument(), mcp.ArgumentDescription("The name of the Pulsar instance, cannot reuse the name of existing instance.")),
76
+
mcp.WithArgument("cluster-name", mcp.RequiredArgument(), mcp.ArgumentDescription("The name of the Pulsar cluster, cannot reuse the name of existing cluster.")),
77
+
mcp.WithArgument("provider", mcp.ArgumentDescription("The cloud provider, could be `aws`, `gcp`, `azure`. If the selected provider do not serve serverless cluster, the prompt will return an error. If not specified, the system will use a random provider depending on the availability.")),
Description: fmt.Sprintf("Pulsar clusters from StreamNative Cloud organization %s, you can use `streamnative_cloud_context_use_cluster` tool to switch to selected cluster, and use pulsar and kafka tools to interact with the cluster.", options.Organization),
144
+
Description: fmt.Sprintf("Pulsar clusters from StreamNative Cloud organization %s, you can use `sncloud_context_use_cluster` tool to switch to selected cluster, and use pulsar and kafka tools to interact with the cluster.", options.Organization),
Description: fmt.Sprintf("Detailed information of Pulsar cluster %s, you can use `streamnative_cloud_context_use_cluster` tool to switch to this cluster, and use pulsar and kafka tools to interact with the cluster.", name),
201
+
Description: fmt.Sprintf("Detailed information of Pulsar cluster %s, you can use `sncloud_context_use_cluster` tool to switch to this cluster, and use pulsar and kafka tools to interact with the cluster.", name),
returnnil, fmt.Errorf("failed to marshal instance: %v", err)
315
+
}
316
+
clusJSON, err:=json.Marshal(clus)
317
+
iferr!=nil {
318
+
returnnil, fmt.Errorf("failed to marshal cluster: %v", err)
319
+
}
320
+
321
+
messages:= []mcp.PromptMessage{
322
+
{
323
+
Content: mcp.TextContent{
324
+
Type: "text",
325
+
Text: "The following is the Pulsar instance JSON definition and the Pulsar cluster JSON definition, you can use the `sncloud_resources_apply` tool to apply the resources to the StreamNative Cloud. Please directly use the JSON content and not modify the content. The PulsarCluster name is required to be empty. You will need to apply PulsarInstance first, then apply PulsarCluster.",
326
+
},
327
+
Role: mcp.RoleUser,
328
+
},
329
+
{
330
+
Content: mcp.TextContent{
331
+
Type: "text",
332
+
Text: string(instJSON),
333
+
},
334
+
Role: mcp.RoleUser,
335
+
},
336
+
{
337
+
Content: mcp.TextContent{
338
+
Type: "text",
339
+
Text: string(clusJSON),
340
+
},
341
+
Role: mcp.RoleUser,
342
+
},
343
+
}
344
+
345
+
return&mcp.GetPromptResult{
346
+
Description: fmt.Sprintf("Create a new Serverless Pulsar cluster %s's related resources that can be applied to the StreamNative Cloud.", clusterName),
mcp.WithDescription("Display the logs of resources in StreamNative Cloud, including pulsar functions, pulsar source connectors, pulsar sink connectors, and kafka connect connectors logs running along with PulsarInstance and PulsarCluster."+
47
-
"This tool is used to help you debug the issues of resources in StreamNative Cloud. You can use `streamnative_cloud_context_use_cluster` to change the context to a specific cluster first, then use this tool to get the logs of resources in the cluster. This tool is suggested to be used with 'pulsar_admin_functions', 'pulsar_admin_sinks', 'pulsar_admin_sources', and 'kafka_admin_connect'"),
47
+
"This tool is used to help you debug the issues of resources in StreamNative Cloud. You can use `sncloud_context_use_cluster` to change the context to a specific cluster first, then use this tool to get the logs of resources in the cluster. This tool is suggested to be used with 'pulsar_admin_functions', 'pulsar_admin_sinks', 'pulsar_admin_sources', and 'kafka_admin_connect'"),
48
48
mcp.WithString("component", mcp.Required(),
49
49
mcp.Description("The component to get logs from, including "+strings.Join(FunctionConnectorList, ", ")),
0 commit comments