Skip to content

Commit f3d09a4

Browse files
committed
fix test
1 parent af168c1 commit f3d09a4

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

cmd/internal/config_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1638,7 +1638,7 @@ func TestPrebuiltTools(t *testing.T) {
16381638
wantToolset: server.ToolsetConfigs{
16391639
"cloud_sql_postgres_admin_tools": tools.ToolsetConfig{
16401640
Name: "cloud_sql_postgres_admin_tools",
1641-
ToolNames: []string{"create_instance", "get_instance", "list_instances", "create_database", "list_databases", "create_user", "wait_for_operation", "postgres_upgrade_precheck", "clone_instance", "create_backup", "restore_backup"},
1641+
ToolNames: []string{"create_instance", "get_instance", "list_instances", "create_database", "list_databases", "create_user", "wait_for_operation", "postgres_upgrade_precheck", "clone_instance", "create_backup", "restore_backup", "execute_sql_many"},
16421642
},
16431643
},
16441644
},

internal/tools/postgres/postgresexecutesqlmany/postgresexecutesqlmany.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ type Config struct {
5252
Name string `yaml:"name" validate:"required"`
5353
Type string `yaml:"type" validate:"required"`
5454
Source string `yaml:"source" validate:"required"`
55-
Description string `yaml:"description" validate:"required"`
55+
Description string `yaml:"description"`
5656
AuthRequired []string `yaml:"authRequired"`
5757
Annotations *tools.ToolAnnotations `yaml:"annotations,omitempty"`
5858
}
@@ -72,13 +72,18 @@ func (cfg Config) Initialize(srcs map[string]sources.Source) (tools.Tool, error)
7272
parameters.NewStringParameter("sql", "The SQL statement to execute."),
7373
}
7474

75+
description := cfg.Description
76+
if description == "" {
77+
description = "Executes multiple SQL statements on a Postgres database."
78+
}
79+
7580
annotations := tools.GetAnnotationsOrDefault(cfg.Annotations, tools.NewDestructiveAnnotations)
76-
mcpManifest := tools.GetMcpManifest(cfg.Name, cfg.Description, cfg.AuthRequired, params, annotations)
81+
mcpManifest := tools.GetMcpManifest(cfg.Name, description, cfg.AuthRequired, params, annotations)
7782

7883
t := Tool{
7984
Config: cfg,
8085
Parameters: params,
81-
manifest: tools.Manifest{Description: cfg.Description, Parameters: params.Manifest(), AuthRequired: cfg.AuthRequired},
86+
manifest: tools.Manifest{Description: description, Parameters: params.Manifest(), AuthRequired: cfg.AuthRequired},
8287
mcpManifest: mcpManifest,
8388
}
8489
return t, nil

0 commit comments

Comments
 (0)