search_gcp_services
Find Google Cloud Platform services and documentation by searching local mappings, official websites, and API repositories to identify relevant GCP tools for specific use cases.
Instructions
Search for GCP (Google Cloud Platform) services and documentation.
USE THIS WHEN: You need to find Google Cloud services, APIs, or documentation for a specific GCP topic.
BEST FOR: Discovering which GCP services exist for a use case or finding service documentation.
Returns multiple matching services with names, descriptions, API endpoints, and docs URLs.
Searches:
1. Local service mapping (exact and partial matches)
2. cloud.google.com website (fallback for specific queries)
3. googleapis GitHub repository (API definitions)
After finding a service, use:
- fetch_gcp_service_docs() to get full documentation content
- The docs_url with WebFetch for external documentation
Note: GitHub API search (fallback) is limited to 60 requests/hour without GITHUB_TOKEN.
Args:
query: Service name or keywords (e.g., "storage", "vertex ai", "gke audit", "bigquery")
limit: Maximum number of results (default 5)
Returns:
JSON with list of matching services including name, description, API endpoint, docs URL
Example: search_gcp_services("vertex ai") → Finds Vertex AI service with docs links
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| limit | No |
Implementation Reference
- src/RTFD/providers/gcp.py:610-641 (handler)The main handler function for the 'search_gcp_services' tool. It invokes internal search logic and returns serialized results.async def search_gcp_services(query: str, limit: int = 5) -> CallToolResult: """ Search for GCP (Google Cloud Platform) services and documentation. USE THIS WHEN: You need to find Google Cloud services, APIs, or documentation for a specific GCP topic. BEST FOR: Discovering which GCP services exist for a use case or finding service documentation. Returns multiple matching services with names, descriptions, API endpoints, and docs URLs. Searches: 1. Local service mapping (exact and partial matches) 2. cloud.google.com website (fallback for specific queries) 3. googleapis GitHub repository (API definitions) After finding a service, use: - fetch_gcp_service_docs() to get full documentation content - The docs_url with WebFetch for external documentation Note: GitHub API search (fallback) is limited to 60 requests/hour without GITHUB_TOKEN. Args: query: Service name or keywords (e.g., "storage", "vertex ai", "gke audit", "bigquery") limit: Maximum number of results (default 5) Returns: JSON with list of matching services including name, description, API endpoint, docs URL Example: search_gcp_services("vertex ai") → Finds Vertex AI service with docs links """ result = await self._search_services(query, limit=limit) return serialize_response_with_meta(result)
- src/RTFD/providers/gcp.py:607-677 (registration)The get_tools method registers 'search_gcp_services' (and conditionally 'fetch_gcp_service_docs') in the tools dictionary for MCP.def get_tools(self) -> dict[str, Callable]: """Return MCP tool functions.""" async def search_gcp_services(query: str, limit: int = 5) -> CallToolResult: """ Search for GCP (Google Cloud Platform) services and documentation. USE THIS WHEN: You need to find Google Cloud services, APIs, or documentation for a specific GCP topic. BEST FOR: Discovering which GCP services exist for a use case or finding service documentation. Returns multiple matching services with names, descriptions, API endpoints, and docs URLs. Searches: 1. Local service mapping (exact and partial matches) 2. cloud.google.com website (fallback for specific queries) 3. googleapis GitHub repository (API definitions) After finding a service, use: - fetch_gcp_service_docs() to get full documentation content - The docs_url with WebFetch for external documentation Note: GitHub API search (fallback) is limited to 60 requests/hour without GITHUB_TOKEN. Args: query: Service name or keywords (e.g., "storage", "vertex ai", "gke audit", "bigquery") limit: Maximum number of results (default 5) Returns: JSON with list of matching services including name, description, API endpoint, docs URL Example: search_gcp_services("vertex ai") → Finds Vertex AI service with docs links """ result = await self._search_services(query, limit=limit) return serialize_response_with_meta(result) async def fetch_gcp_service_docs(service: str, max_bytes: int = 20480) -> CallToolResult: """ Fetch actual documentation content for a GCP (Google Cloud Platform) service. USE THIS WHEN: You need detailed documentation, guides, tutorials, or API reference for a GCP service. BEST FOR: Getting complete documentation with setup instructions, usage examples, and API details. Better than using curl or WebFetch because it: - Automatically extracts relevant content from cloud.google.com - Converts HTML to clean Markdown format - Prioritizes important sections (Overview, Quickstart, API Reference) - Removes navigation, ads, and other non-content elements - Handles multi-word service names (e.g., "gke audit policy") Works with: - Exact service names (e.g., "Cloud Storage", "Compute Engine") - Common abbreviations (e.g., "GCS", "GKE", "BigQuery") - Multi-word queries (e.g., "gke audit policy configuration") Args: service: Service name or topic (e.g., "Cloud Storage", "vertex ai", "gke audit") max_bytes: Maximum content size, default 20KB (increase for comprehensive docs) Returns: JSON with documentation content, size, source URL, truncation status Example: fetch_gcp_service_docs("vertex ai") → Returns formatted documentation from cloud.google.com """ result = await self._fetch_service_docs(service, max_bytes) return serialize_response_with_meta(result) tools = {"search_gcp_services": search_gcp_services} if is_fetch_enabled(): tools["fetch_gcp_service_docs"] = fetch_gcp_service_docs return tools
- src/RTFD/providers/gcp.py:149-162 (registration)The get_metadata method lists 'search_gcp_services' in tool_names for provider registration.def get_metadata(self) -> ProviderMetadata: tool_names = ["search_gcp_services"] if is_fetch_enabled(): tool_names.append("fetch_gcp_service_docs") return ProviderMetadata( name="gcp", description="Google Cloud Platform API and service documentation", expose_as_tool=True, tool_names=tool_names, supports_library_search=True, required_env_vars=[], optional_env_vars=["GITHUB_TOKEN", "GITHUB_AUTH"], )
- src/RTFD/providers/gcp.py:226-334 (helper)Core helper method implementing the search logic: local mapping, normalization, web search fallback, and GitHub API search.async def _search_services(self, query: str, limit: int = 5) -> list[dict[str, Any]]: """ Search for GCP services using GitHub API and local mapping. Args: query: Search query (e.g., "storage", "compute", "bigquery", "gke audit") limit: Maximum number of results to return Returns: List of matching services with metadata """ results: list[dict[str, Any]] = [] # First, check if query matches any known service normalized = self._normalize_service_name(query) if normalized and normalized in GCP_SERVICE_DOCS: service_info = GCP_SERVICE_DOCS[normalized] results.append( { "name": service_info["name"], "description": service_info["description"], "api": service_info["api"], "docs_url": service_info["url"], "source": "gcp_mapping", } ) # Search our local mapping for partial matches query_lower = query.lower() # If query has multiple words (e.g., "gke audit"), try first word as service query_words = query_lower.split() if len(query_words) > 1 and not results: # Try to find service from first word first_word_normalized = self._normalize_service_name(query_words[0]) if first_word_normalized and first_word_normalized in GCP_SERVICE_DOCS: service_info = GCP_SERVICE_DOCS[first_word_normalized] # Add note about topic in description topic = " ".join(query_words[1:]) results.append( { "name": service_info["name"], "description": f"{service_info['description']} (searching for: {topic})", "api": service_info["api"], "docs_url": service_info["url"], "source": "gcp_mapping_contextual", } ) # Search for partial matches in service names and descriptions for key, service_info in GCP_SERVICE_DOCS.items(): # Skip if already added if normalized == key: continue if len(query_words) > 1 and self._normalize_service_name(query_words[0]) == key: continue # Check if ANY word in query matches service name, key, or description query_matches = False for word in query_words: if len(word) > 2: # Skip very short words if ( word in service_info["name"].lower() or word in key or word in service_info["description"].lower() ): query_matches = True break if query_matches: results.append( { "name": service_info["name"], "description": service_info["description"], "api": service_info["api"], "docs_url": service_info["url"], "source": "gcp_mapping", } ) if len(results) >= limit: break # If we have results from local mapping (either exact or partial matches), # prioritize those over external searches if results: return results[:limit] # Only search cloud.google.com if we don't have local matches # This is for very specific queries that aren't in our mapping try: cloud_results = await self._search_cloud_google_com(query, limit) if cloud_results: results.extend(cloud_results) except Exception: pass if len(results) >= limit: return results[:limit] # Finally, try GitHub API search for googleapis repository try: github_results = await self._search_github_googleapis(query, limit) results.extend(github_results) except Exception: pass return results[:limit]
- src/RTFD/providers/gcp.py:610-638 (schema)Type hints and docstring define the input schema (query: str, limit: int=5) and output format for the tool.async def search_gcp_services(query: str, limit: int = 5) -> CallToolResult: """ Search for GCP (Google Cloud Platform) services and documentation. USE THIS WHEN: You need to find Google Cloud services, APIs, or documentation for a specific GCP topic. BEST FOR: Discovering which GCP services exist for a use case or finding service documentation. Returns multiple matching services with names, descriptions, API endpoints, and docs URLs. Searches: 1. Local service mapping (exact and partial matches) 2. cloud.google.com website (fallback for specific queries) 3. googleapis GitHub repository (API definitions) After finding a service, use: - fetch_gcp_service_docs() to get full documentation content - The docs_url with WebFetch for external documentation Note: GitHub API search (fallback) is limited to 60 requests/hour without GITHUB_TOKEN. Args: query: Service name or keywords (e.g., "storage", "vertex ai", "gke audit", "bigquery") limit: Maximum number of results (default 5) Returns: JSON with list of matching services including name, description, API endpoint, docs URL Example: search_gcp_services("vertex ai") → Finds Vertex AI service with docs links """