Skip to content

Conversation

Myst9
Copy link
Contributor

@Myst9 Myst9 commented Aug 29, 2025

Description


This pull request introduces a new custom tool kind cloud-sql-mysql-list-tables that allows users to list tables within a Cloud SQL for MySQL database.

Example Configuration

tools:
  cloud_sql_mysql_list_tables:
    kind: cloud-sql-mysql-list-tables
    source: cloud-sql-mysql-source
    description: Use this tool to retrieve schema information for all or specified tables. Output format can be simple (only table names) or detailed.

Example Request

curl -X POST http://127.0.0.1:5000/api/tool/cloud_sql_mysql_list_tables/invoke \
-H "Content-Type: application/json" \
-d '{
    "table_names": "users",
    "output_format": "simple"
}'

PR Checklist


Thank you for opening a Pull Request! Before submitting your PR, there are a
few things you can do to make sure it goes smoothly:

  • Make sure you reviewed
    CONTRIBUTING.md
  • Make sure to open an issue as a
    bug/issue
    before writing your code! That way we can discuss the change, evaluate
    designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)
  • Make sure to add ! if this involve a breaking change

Copy link
Contributor

1 similar comment
Copy link
Contributor

@Myst9 Myst9 force-pushed the cloudsql-mysql-custom-tool branch from 51ddd85 to eba2bf7 Compare August 29, 2025 09:14
Copy link
Contributor

}

func (t Tool) RequiresClientAuthorization() bool {
return false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In other pull requests as well is this method required if it is always false

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it is throwing an error if this method is not implemented

Copy link
Contributor

@Myst9 Myst9 marked this pull request as ready for review August 29, 2025 09:54
@Myst9 Myst9 requested a review from a team as a code owner August 29, 2025 09:54
@Myst9 Myst9 requested review from averikitsch and Yuan325 August 29, 2025 10:01
@Yuan325 Yuan325 changed the title feat!: Add custom tool kind for list-tables - cloud-sql-mysql feat!: Add custom tool kind for list-tables-cloud-sql-mysql Aug 29, 2025
@Yuan325 Yuan325 changed the title feat!: Add custom tool kind for list-tables-cloud-sql-mysql feat(tools/cloud-sql-mysql-list-tables)!: Add new tool for cloud-sql-mysql Aug 29, 2025
Copy link
Contributor

@averikitsch averikitsch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need to scope this tool to Cloud SQL. This could be a MySQL tool under /internal/tools/mysql and support any MySQL source

type: docs
weight: 1
description: >
Tools that work with CloudSQL MySQL Sources.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cloud SQL should be 2 words. Please update everywhere

@@ -0,0 +1,7 @@
---
title: "CloudSQLMySQL"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use the full name Cloud SQL for MySQL

The `cloud-sql-mysql-list-tables` tool retrieves schema information for all or specified tables in a CloudSQL for MySQL database.
It is compatible with [cloud-sql-mysql](../../sources/cloud-sql-mysql.md) source.

`cloud-sql-mysql-list-tables` lists detailed schema information (object type, columns, constraints, indexes, triggers, owner, comment) as JSON for user-created tables (ordinary or partitioned). Filters by a comma-separated list of names. If names are omitted, it lists all tables in user schemas. The output format can be set to `simple` which will return only the table names or `detailed` which is the default.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is nice, but we may want to standardize on a "## Parameters" section

}

// validate compatible sources are still compatible
var _ compatibleSource = &cloudsqlmysql.Source{}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be compatible with generic mySql as well

@averikitsch
Copy link
Contributor

This should not be labeled as a breaking change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants