8000 more docs fixes · mark3labs/mcp-go@5c49f63 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5c49f63

Browse files
committed
more docs fixes
1 parent b5db567 commit 5c49f63

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

www/docs/pages/clients/operations.mdx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,8 +389,13 @@ func validateToolArguments(tool mcp.Tool, args map[string]interface{}) error {
389389
return nil
390390
}
391391

392-
func validateValue(value interface{}, schema mcp.Schema) error {
393-
switch schema.Type {
392+
func validateValue(value interface{}, schema map[string]any) error {
393+
schemaType, ok := schema["type"].(string)
394+
if !ok {
395+
return fmt.Errorf("schema missing type")
396+
}
397+
398+
switch schemaType {
394399
case "string":
395400
if _, ok := value.(string); !ok {
396401
return fmt.Errorf("expected string, got %T", value)

www/docs/pages/servers/tools.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,15 @@ mcp.WithBoolean("enabled",
6262
// Array parameters
6363
mcp.WithArray("tags",
6464
mcp.Description("List of tags"),
65-
mcp.Items(mcp.StringSchema()),
65+
mcp.Items(map[string]any{"type": "string"}),
6666
)
6767

6868
// Object parameters
6969
mcp.WithObject("config",
7070
mcp.Description("Configuration object"),
71-
mcp.Properties(map[string]mcp.Schema{
72-
"timeout": mcp.NumberSchema(),
73-
"retries": mcp.IntegerSchema(),
71+
mcp.Properties(map[string]any{
72+
"timeout": map[string]any{"type": "number"},
73+
"retries": map[string]any{"type": "integer"},
7474
}),
7575
)
7676
```
@@ -581,7 +581,7 @@ tool := mcp.NewTool("search_database",
581581
),
582582
mcp.WithArray("categories",
583583
mcp.Description("Filter by product categories"),
584-
mcp.Items(mcp.StringSchema()),
584+
mcp.Items(map[string]any{"type": "string"}),
585585
),
586586
)
587587

0 commit comments

Comments
 (0)
0