Skip to main content
Glama

list-projects

Retrieve all Google Cloud Platform projects accessible with your current credentials using this tool. Manage and query GCP services effectively across multiple projects.

Instructions

List all GCP projects accessible with current credentials

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • index.ts:98-106 (registration)
    Registration of the 'list-projects' tool in the ListTools response, defining its name, description, and empty input schema.
    { name: "list-projects", description: "List all GCP projects accessible with current credentials", inputSchema: { type: "object", properties: {}, required: [], }, },
  • Handler logic in CallToolRequestSchema: invokes listAvailableProjects() helper and formats response as JSON.
    } else if (name === "list-projects") { const projects = await listAvailableProjects(); return createTextResponse(JSON.stringify({ projects }));
  • Core implementation: Uses Google Cloud's ProjectsClient to search and list accessible projects, serializes each to JSON string, handles errors gracefully.
    async function listAvailableProjects(): Promise<string[]> { const projectsClient = new ProjectsClient(); try { const [projects] = await projectsClient.searchProjects(); return projects.map((p: any) => JSON.stringify(p)); } catch (error) { console.error('Error listing projects:', error); return []; } }

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