Skip to main content
Glama

gcp_services_list

Read-onlyIdempotent

Lists enabled Google Cloud Platform services and APIs for a project to help users identify available resources and manage configurations.

Instructions

API 목록|활성화된 서비스|enabled APIs|services - 프로젝트에서 활성화된 API 서비스 목록을 조회합니다

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idNoGCP 프로젝트 ID (기본: 현재 설정된 프로젝트)
filterNo서비스 이름 필터 (예: "run", "sql", "storage")
formatNo출력 형식 (기본: text)text

Implementation Reference

  • The main handler function that lists enabled GCP services using 'gcloud services list', parses JSON output, filters if specified, categorizes services, and returns formatted text or JSON response.
    export async function gcpServicesList(args: GcpServicesListArgs) {
      try {
        const projectId = await getProjectId(args.project_id);
    
        const command = `services list --enabled --project=${projectId} --format=json`;
        const result = await executeGcloud(command, 30000);
    
        let services: any[] = [];
        try {
          services = JSON.parse(result.stdout || '[]');
        } catch {
          services = [];
        }
    
        // Extract service info
        let serviceList = services.map((s: any) => ({
          name: s.config?.name || s.name,
          title: s.config?.title,
          state: s.state,
        }));
    
        // Apply filter if provided
        if (args.filter) {
          const filterLower = args.filter.toLowerCase();
          serviceList = serviceList.filter((s) =>
            s.name?.toLowerCase().includes(filterLower) ||
            s.title?.toLowerCase().includes(filterLower)
          );
        }
    
        if (args.format === 'json') {
          return {
            content: [
              {
                type: 'text',
                text: JSON.stringify({
                  project: projectId,
                  filter: args.filter,
                  totalServices: serviceList.length,
                  services: serviceList,
                }, null, 2),
              },
            ],
          };
        }
    
        const lines = [
          '🔌 활성화된 API 서비스',
          `프로젝트: ${projectId}`,
          args.filter ? `필터: "${args.filter}"` : '',
          `총 ${serviceList.length}개`,
          '',
        ].filter(Boolean);
    
        if (serviceList.length === 0) {
          lines.push('활성화된 서비스가 없습니다.');
        } else {
          // Group by category
          const categories: Record<string, any[]> = {
            'Compute': [],
            'Storage': [],
            'Database': [],
            'AI/ML': [],
            'Networking': [],
            'Security': [],
            'Other': [],
          };
    
          serviceList.forEach((s) => {
            const name = s.name?.toLowerCase() || '';
            if (name.includes('run') || name.includes('compute') || name.includes('functions') || name.includes('appengine')) {
              categories['Compute'].push(s);
            } else if (name.includes('storage') || name.includes('firestore')) {
              categories['Storage'].push(s);
            } else if (name.includes('sql') || name.includes('spanner') || name.includes('bigtable') || name.includes('redis')) {
              categories['Database'].push(s);
            } else if (name.includes('ai') || name.includes('ml') || name.includes('vision') || name.includes('speech') || name.includes('translate') || name.includes('vertex')) {
              categories['AI/ML'].push(s);
            } else if (name.includes('vpc') || name.includes('dns') || name.includes('loadbalancing') || name.includes('network')) {
              categories['Networking'].push(s);
            } else if (name.includes('iam') || name.includes('secret') || name.includes('kms') || name.includes('security')) {
              categories['Security'].push(s);
            } else {
              categories['Other'].push(s);
            }
          });
    
          for (const [category, items] of Object.entries(categories)) {
            if (items.length > 0) {
              lines.push(`\n📂 ${category}:`);
              items.forEach((s) => {
                lines.push(`  ✅ ${s.name}`);
                if (s.title) {
                  lines.push(`     └ ${s.title}`);
                }
              });
            }
          }
        }
    
        return {
          content: [
            {
              type: 'text',
              text: lines.join('\n'),
            },
          ],
        };
      } catch (error: any) {
        return {
          content: [
            {
              type: 'text',
              text: formatError(error),
            },
          ],
          isError: true,
        };
      }
    }
  • Tool schema definition including name, description, annotations, and input schema for project_id, filter, and format parameters.
    export const gcpServicesListDefinition = {
      name: 'gcp_services_list',
      description: 'API 목록|활성화된 서비스|enabled APIs|services - 프로젝트에서 활성화된 API 서비스 목록을 조회합니다',
      annotations: {
        title: 'GCP API 서비스 목록',
        readOnlyHint: true,
        destructiveHint: false,
        idempotentHint: true,
        openWorldHint: true,
      },
      inputSchema: {
        type: 'object' as const,
        properties: {
          project_id: {
            type: 'string',
            description: 'GCP 프로젝트 ID (기본: 현재 설정된 프로젝트)',
          },
          filter: {
            type: 'string',
            description: '서비스 이름 필터 (예: "run", "sql", "storage")',
          },
          format: {
            type: 'string',
            enum: ['text', 'json'],
            description: '출력 형식 (기본: text)',
            default: 'text',
          },
        },
        required: [],
      },
    };
  • src/index.ts:78-89 (registration)
    Registration of the tool definition in the tools array returned by ListToolsRequestSchema handler.
      gcpSetupDefinition,
      gcpLogsReadDefinition,
      gcpRunStatusDefinition,
      gcpRunLogsDefinition,
      gcpSqlQueryDefinition,
      gcpSqlProxyDefinition,
      gcpStorageListDefinition,
      gcpSecretListDefinition,
      gcpAuthStatusDefinition,
      gcpServicesListDefinition,
      gcpBillingInfoDefinition,
    ];
  • src/index.ts:229-230 (registration)
    Dispatch to the gcpServicesList handler in the CallToolRequestSchema switch statement.
    case 'gcp_services_list':
      return await gcpServicesList(args as any) as CallToolResult;
  • TypeScript interface defining the input arguments for the handler, matching the schema.
    interface GcpServicesListArgs {
      project_id?: string;
      filter?: string;
      format?: 'text' | 'json';
    }
Behavior4/5

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

Annotations already provide readOnlyHint=true, destructiveHint=false, idempotentHint=true, and openWorldHint=true, covering safety and idempotency. The description adds useful context about retrieving '활성화된 서비스' (enabled services), clarifying it lists only active APIs rather than all available ones, which isn't captured in annotations. No contradiction with annotations exists.

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

Conciseness4/5

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

The description is concise and front-loaded, starting with key terms ('API 목록|활성화된 서비스|enabled APIs|services') followed by the core function. However, the mixed language (Korean and English) and pipe-separated terms slightly reduce clarity, though it remains efficient with no wasted sentences.

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

Completeness4/5

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

Given the tool's low complexity (list operation), rich annotations (covering safety and behavior), and full schema coverage, the description is mostly complete. It lacks output details (no output schema), but annotations and context imply a read-only list, making it sufficient for agent use. A minor gap exists in not mentioning authentication or project setup prerequisites.

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

Parameters3/5

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

Schema description coverage is 100%, with all parameters well-documented in the schema (project_id, filter, format). The description doesn't add any additional parameter semantics beyond what's in the schema, such as explaining filter syntax further or format implications. Baseline 3 is appropriate since the schema handles parameter documentation adequately.

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 tool's purpose with specific verbs ('조회합니다' - retrieve/list) and resources ('프로젝트에서 활성화된 API 서비스 목록' - list of enabled API services in a project). It distinguishes itself from siblings like gcp_billing_info or gcp_storage_list by focusing specifically on API services rather than billing, storage, or other GCP resources.

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

Usage Guidelines3/5

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

The description implies usage context (retrieving enabled APIs for a GCP project) but doesn't explicitly state when to use this tool versus alternatives. No guidance is provided about prerequisites (like authentication status) or comparisons with similar tools (though siblings are mostly distinct in function).

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/su-record/hi-gcloud'

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