Skip to main content
Glama

select-project

Select a Google Cloud Platform project to manage resources like Compute Engine, Cloud Storage, and BigQuery for subsequent operations.

Instructions

Selects GCP project to use for subsequent interactions

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYesID of the GCP project to select
regionNoRegion to use (if not provided, us-central1 is used)

Implementation Reference

  • The main handler logic for executing the 'select-project' tool. It validates input using Zod schema, initializes credentials, sets the selected project ID and region, and returns a success message.
    } else if (name === "select-project") { const { projectId, region } = SelectProjectSchema.parse(args); selectedProjectCredentials = await auth.getClient(); selectedProject = projectId; selectedRegion = region || "us-central1"; return createTextResponse("Project selected successfully!");
  • index.ts:107-124 (registration)
    Registration of the 'select-project' tool in the ListTools response, defining its name, description, and JSON input schema.
    { name: "select-project", description: "Selects GCP project to use for subsequent interactions", inputSchema: { type: "object", properties: { projectId: { type: "string", description: "ID of the GCP project to select", }, region: { type: "string", description: "Region to use (if not provided, us-central1 is used)", }, }, required: ["projectId"], }, },
  • Zod runtime validation schema for the 'select-project' tool inputs, used in the handler for parsing arguments.
    const SelectProjectSchema = z.object({ projectId: z.string(), region: z.string().optional(), });
  • Helper function for selecting a project with authentication initialization and error handling, similar to handler logic but not directly invoked by the tool.
    const selectProject = async (projectId: string, region?: string) => { try { selectedProject = projectId; selectedRegion = region || "us-central1"; selectedProjectCredentials = await initializeAuth(); return true; } catch (error) { console.error('Failed to select project:', error); selectedProject = null; selectedProjectCredentials = null; throw error; } };

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