Skip to main content
Glama

gcp_run_status

Read-onlyIdempotent

Check Cloud Run service status and deployment state in Google Cloud Platform. Retrieve service health, region details, and project information for monitoring and troubleshooting.

Instructions

Cloud Run 상태|서비스 상태|배포 상태|run status - Cloud Run 서비스 상태를 조회합니다

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
serviceYesCloud Run 서비스 이름
regionNo리전 (예: asia-northeast3). 기본: gcloud 설정값
project_idNoGCP 프로젝트 ID (기본: 현재 설정된 프로젝트)
formatNo출력 형식 (기본: text)text

Implementation Reference

  • Main handler function that executes the tool: builds and runs gcloud command to describe Cloud Run service, parses output, formats status, handles errors.
    export async function gcpRunStatus(args: GcpRunStatusArgs) {
      try {
        const projectId = await getProjectId(args.project_id);
    
        // Build command
        let command = `run services describe ${args.service} --project=${projectId} --format=json`;
        if (args.region) {
          command += ` --region=${args.region}`;
        }
    
        const result = await executeGcloud(command, 30000);
    
        // Parse JSON output
        let serviceInfo: any = {};
        try {
          serviceInfo = JSON.parse(result.stdout || '{}');
        } catch {
          serviceInfo = {};
        }
    
        // Extract relevant information
        const status = {
          name: serviceInfo.metadata?.name || args.service,
          url: serviceInfo.status?.url || 'N/A',
          region: args.region || serviceInfo.metadata?.labels?.['cloud.googleapis.com/location'] || 'N/A',
          revision: serviceInfo.status?.latestReadyRevisionName || 'N/A',
          status: serviceInfo.status?.conditions?.find((c: any) => c.type === 'Ready')?.status === 'True' ? 'Ready' : 'Not Ready',
          traffic: serviceInfo.status?.traffic?.map((t: any) => ({
            revisionName: t.revisionName || t.latestRevision ? 'latest' : 'unknown',
            percent: t.percent || 0,
          })) || [],
          lastDeployed: serviceInfo.metadata?.creationTimestamp || null,
          containerImage: serviceInfo.spec?.template?.spec?.containers?.[0]?.image || 'N/A',
        };
    
        if (args.format === 'json') {
          return {
            content: [
              {
                type: 'text',
                text: JSON.stringify({
                  project: projectId,
                  ...status,
                  raw: serviceInfo,
                }, null, 2),
              },
            ],
          };
        }
    
        return {
          content: [
            {
              type: 'text',
              text: formatRunStatus(status),
            },
          ],
        };
      } catch (error: any) {
        return {
          content: [
            {
              type: 'text',
              text: formatError(error),
            },
          ],
          isError: true,
        };
      }
    }
  • Tool schema definition including name, description, annotations, and inputSchema with properties for service, region, project_id, format.
    export const gcpRunStatusDefinition = {
      name: 'gcp_run_status',
      description: 'Cloud Run 상태|서비스 상태|배포 상태|run status - Cloud Run 서비스 상태를 조회합니다',
      annotations: {
        title: 'Cloud Run 상태 조회',
        readOnlyHint: true,
        destructiveHint: false,
        idempotentHint: true,
        openWorldHint: true,
      },
      inputSchema: {
        type: 'object' as const,
        properties: {
          service: {
            type: 'string',
            description: 'Cloud Run 서비스 이름',
          },
          region: {
            type: 'string',
            description: '리전 (예: asia-northeast3). 기본: gcloud 설정값',
          },
          project_id: {
            type: 'string',
            description: 'GCP 프로젝트 ID (기본: 현재 설정된 프로젝트)',
          },
          format: {
            type: 'string',
            enum: ['text', 'json'],
            description: '출력 형식 (기본: text)',
            default: 'text',
          },
        },
        required: ['service'],
      },
    };
  • src/index.ts:77-89 (registration)
    Registration of all tools including gcpRunStatusDefinition in the tools array used for ListToolsRequestHandler.
    const tools = [
      gcpSetupDefinition,
      gcpLogsReadDefinition,
      gcpRunStatusDefinition,
      gcpRunLogsDefinition,
      gcpSqlQueryDefinition,
      gcpSqlProxyDefinition,
      gcpStorageListDefinition,
      gcpSecretListDefinition,
      gcpAuthStatusDefinition,
      gcpServicesListDefinition,
      gcpBillingInfoDefinition,
    ];
  • src/index.ts:217-218 (registration)
    Dispatch/execution handler in the CallToolRequestSchema switch case that calls the gcpRunStatus function.
    case 'gcp_run_status':
      return await gcpRunStatus(args as any) as CallToolResult;
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 minimal behavioral context by specifying it's for '상태 조회' (status retrieval), which aligns with annotations but doesn't add significant value beyond them. No contradictions exist.

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

Conciseness3/5

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

The description is concise with a single sentence, but it includes redundant synonyms ('Cloud Run 상태|서비스 상태|배포 상태|run status') before the core purpose, which adds noise without value. The core statement is clear but could be more front-loaded without the synonyms.

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

Completeness3/5

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

Given the annotations cover safety and idempotency, and the schema fully documents parameters, the description is adequate but minimal. It lacks output details (no output schema provided) and doesn't explain return values or error conditions, leaving some gaps for a status-checking tool.

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 (e.g., service name, region, project_id, format with enum). The description doesn't add any parameter semantics beyond what the schema provides, so it meets the baseline of 3 for high schema coverage.

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

Purpose4/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 as 'Cloud Run 서비스 상태를 조회합니다' (retrieves Cloud Run service status), which is a specific verb+resource combination. However, it doesn't distinguish this from sibling tools like 'gcp_run_logs' or 'gcp_services_list', which might also retrieve related information about Cloud Run services.

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. It doesn't mention sibling tools like 'gcp_run_logs' (which might retrieve logs instead of status) or 'gcp_services_list' (which might list services rather than check their status), leaving the agent to infer usage context from the tool name alone.

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