select-project
Specify a Google Cloud Platform project and region for managing and querying GCP resources like Compute Engine, Cloud Storage, and BigQuery.
Instructions
Selects GCP project to use for subsequent interactions
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectId | Yes | ID of the GCP project to select | |
| region | No | Region to use (if not provided, us-central1 is used) |
Implementation Reference
- index.ts:407-412 (handler)Handler logic for the 'select-project' tool. Parses input, sets selectedProject, selectedRegion, and selectedProjectCredentials using GoogleAuth, returns 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:223-226 (schema)Zod schema for validating 'select-project' tool inputs.const SelectProjectSchema = z.object({ projectId: z.string(), region: z.string().optional(), });
- index.ts:107-124 (registration)Registration of 'select-project' tool in the listTools response, including input schema definition.{ 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"], }, },
- index.ts:293-305 (helper)Helper function 'selectProject' for selecting project with error handling (not directly used by tool handler).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; } };