Skip to main content
Glama

list-sql-instances

Retrieve all Cloud SQL instances in your current GCP project to manage database resources and monitor configurations.

Instructions

List all Cloud SQL instances in the current project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function that executes the 'list-sql-instances' tool. It checks if a project is selected, creates a SqlInstancesServiceClient, lists the instances for the project, maps them to a simplified format, and returns the JSON response. Handles errors gracefully.
    } else if (name === "list-sql-instances") {
      if (!selectedProject) {
        return createTextResponse("No project selected. Please select a project first.");
      }
    
      try {
        const sqlClient = new SqlInstancesServiceClient({
          fallback: 'rest'  // Use HTTP/1.1 fallback mode instead of gRPC
        });
        
        const request = {
          project: selectedProject
        };
    
        const [response] = await sqlClient.list(request);
    
        return createTextResponse(JSON.stringify({
          instances: (response?.items || []).map(instance => ({
            name: instance.name || null,
            databaseVersion: instance.databaseVersion || null,
            state: instance.state || null,
            region: instance.region || null
          }))
        }, null, 2));
      } catch (error: any) {
        console.error('Error listing SQL instances:', error);
        return createTextResponse(`Error listing SQL instances: ${error.message}`);
      }
    } else if (name === "get-logs") {
  • index.ts:186-193 (registration)
    Registration of the 'list-sql-instances' tool in the server's listTools response, including name, description, and input schema (empty object since no parameters required).
      name: "list-sql-instances",
      description: "List all Cloud SQL instances in the current project",
      inputSchema: {
        type: "object",
        properties: {},
        required: [],
      },
    },
  • TypeScript interface defining the structure of SQL instances returned by the handler, used for type safety in the response mapping.
    interface SQLInstance {
      name: string | null;
      databaseVersion: string | null;
      state: string | null;
      region: string | null;
    }
  • Import of the SqlInstancesServiceClient used by the handler.
    import { SqlInstancesServiceClient } from '@google-cloud/sql';
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but only states the basic action. It doesn't disclose behavioral traits such as pagination, rate limits, authentication requirements, error conditions, or what 'current project' means contextually. This leaves significant gaps for an agent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core purpose with zero wasted words. It's appropriately sized for a simple list operation with no parameters.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with no annotations, no output schema, and no parameters, the description is too minimal. It doesn't address what the output contains (e.g., instance details, formats), error handling, or dependencies on project context, leaving the agent with incomplete operational understanding.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description appropriately doesn't add parameter details, earning a baseline score of 4 for not introducing unnecessary information.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific verb 'List' and resource 'all Cloud SQL instances in the current project', which distinguishes it from sibling tools like list-gke-clusters or list-projects. It precisely defines scope without ambiguity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like list-projects or list-gke-clusters, nor does it mention any prerequisites or exclusions. It simply states what the tool does without contextual usage information.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/RadiumGu/gcp-ops-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server