Skip to content

Commit 87660a6

Browse files
authored
Ensure array definition has items type (#112)
The `list_resources` function didn't declare a type for both array parameters it takes. While this works in other Clients like Cursor and Roo, it did not in VSCode which enforces this more thoroughly. This fixes that issue. Related-to: #107 Signed-off-by: Juan Antonio Osorio <ozz@stacklok.com>
1 parent 291d840 commit 87660a6

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

pkg/mcp/tools.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,17 @@ func NewListResourcesTool() mcp.Tool {
2828
mcp.WithBoolean("include_annotations",
2929
mcp.Description("Whether to include annotations in the output (default: true)")),
3030
mcp.WithArray("exclude_annotation_keys",
31-
mcp.Description("List of annotation keys to exclude from output (supports wildcards with *)")),
31+
mcp.Description("List of annotation keys to exclude from output (supports wildcards with *)"),
32+
mcp.Items(map[string]any{
33+
"type": "string",
34+
}),
35+
),
3236
mcp.WithArray("include_annotation_keys",
33-
mcp.Description("List of annotation keys to include in output (if specified, only these are included)")),
37+
mcp.Description("List of annotation keys to include in output (if specified, only these are included)"),
38+
mcp.Items(map[string]any{
39+
"type": "string",
40+
}),
41+
),
3442
mcp.WithNumber("limit",
3543
mcp.Description("Maximum number of resources to return (0 means no limit, default: 0)")),
3644
mcp.WithString("continue",

0 commit comments

Comments
 (0)