retrieving-developer-knowledge
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGoogle Developer Knowledge
谷歌开发者知识库
The Developer Knowledge skill provides access to official Google developer documentation across Google Cloud, AI/ML (ai.google.dev, ADK, TensorFlow), Android, Chrome, Web, Flutter, Go, Firebase, and other Google developer platforms via the Developer Knowledge MCP server or REST API fallback.
Developer Knowledge技能可通过Developer Knowledge MCP服务器或REST API备选方案,访问Google Cloud、AI/ML(ai.google.dev、ADK、TensorFlow)、Android、Chrome、Web、Flutter、Go、Firebase及其他谷歌开发者平台的官方谷歌开发者文档。
Workflow
工作流
- Direct Retrieval: When answering a technical question, execute a single documentation lookup directly within your current conversation context (do not delegate retrieval to subagents):
- If MCP tools are present in your environment: Call (for conceptual guides/workflows) or
answer_query(for CLI flags/syntax).search_documents - If MCP tools are not present: Execute a REST API request via against
curl.https://developerknowledge.googleapis.com/v1
- If MCP tools are present in your environment: Call
- Immediate & Complete Solution Output: Immediately upon receiving the documentation response, output the complete, self-contained, and executable technical solution (commands with all required flags and placeholders, YAML/JSON configurations, or code snippets) directly in your response text.
- 直接检索:在回答技术问题时,直接在当前对话语境中执行单次文档查询(无需将检索任务委托给子Agent):
- 若环境中存在MCP工具:调用(用于概念指南/工作流)或
answer_query(用于CLI标志/语法)。search_documents - 若环境中不存在MCP工具:通过向
curl发送REST API请求。https://developerknowledge.googleapis.com/v1
- 若环境中存在MCP工具:调用
- 即时输出完整解决方案:收到文档响应后,立即在回复文本中输出完整、独立且可执行的技术解决方案(包含所有必要标志和占位符的命令、YAML/JSON配置或代码片段)。
Tool Selection & Usage
工具选择与使用
Choose the appropriate tool based on availability in your runtime environment:
根据运行时环境中的工具可用性选择合适的工具:
1. Developer Knowledge MCP Tools (Preferred)
1. Developer Knowledge MCP工具(首选)
When MCP tools are present in your active tool definitions:
- : Use for conceptual guides, architectural comparisons, product choice overviews, and multi-step workflows.
answer_query(query="...") - : Use for granular CLI flags, exact syntax, parameter names, and IAM permissions (
search_documents(query="...", page_size=5)). Use 2–5 focused keywords (e.g.,service.resource.verb) rather than full conversational sentences.cloud run filestore nfs mount gcloud - : Fetch full documentation pages by resource name (e.g.
get_documents(names=["documents/{uri_without_scheme}"])).names: ["documents/docs.cloud.google.com/run/docs/overview/what-is-cloud-run"]
当活跃工具定义中存在MCP工具时:
- :用于概念指南、架构对比、产品选型概述及多步骤工作流。
answer_query(query="...") - :用于细粒度CLI标志、精确语法、参数名称及IAM权限(
search_documents(query="...", page_size=5))。使用2–5个聚焦关键词(例如service.resource.verb),而非完整的对话式语句。cloud run filestore nfs mount gcloud - :通过资源名称获取完整文档页面(例如
get_documents(names=["documents/{uri_without_scheme}"]))。names: ["documents/docs.cloud.google.com/run/docs/overview/what-is-cloud-run"]
2. REST API Fallback
2. REST API备选方案
When MCP tools are not declared in your environment, use HTTP requests () against the Developer Knowledge REST API () with the environment API key ():
curlhttps://developerknowledge.googleapis.com/v1DEVELOPERKNOWLEDGE_API_KEY- Answer Query:
bash
curl -s -X POST "https://developerknowledge.googleapis.com/v1:answerQuery?key=${DEVELOPERKNOWLEDGE_API_KEY}" \ -H "Content-Type: application/json" \ -d '{"query": "How do I configure public read access on Cloud Storage?"}' - Search Document Chunks (use 2–5 focused keywords):
bash
curl -s "https://developerknowledge.googleapis.com/v1/documents:searchDocumentChunks?query=gcloud+logging+metrics+create&key=${DEVELOPERKNOWLEDGE_API_KEY}" - Get Document:
bash
curl -s "https://developerknowledge.googleapis.com/v1/documents/docs.cloud.google.com/run/docs/overview/what-is-cloud-run?key=${DEVELOPERKNOWLEDGE_API_KEY}" - Batch Get Documents:
bash
curl -s -X POST "https://developerknowledge.googleapis.com/v1/documents:batchGet?key=${DEVELOPERKNOWLEDGE_API_KEY}" \ -H "Content-Type: application/json" \ -d '{"names": ["documents/docs.cloud.google.com/run/docs/overview/what-is-cloud-run"]}'
当环境中未声明MCP工具时,使用HTTP请求()调用Developer Knowledge REST API(),并使用环境API密钥():
curlhttps://developerknowledge.googleapis.com/v1DEVELOPERKNOWLEDGE_API_KEY- Answer Query:
bash
curl -s -X POST "https://developerknowledge.googleapis.com/v1:answerQuery?key=${DEVELOPERKNOWLEDGE_API_KEY}" \ -H "Content-Type: application/json" \ -d '{"query": "How do I configure public read access on Cloud Storage?"}' - Search Document Chunks(使用2–5个聚焦关键词):
bash
curl -s "https://developerknowledge.googleapis.com/v1/documents:searchDocumentChunks?query=gcloud+logging+metrics+create&key=${DEVELOPERKNOWLEDGE_API_KEY}" - Get Document:
bash
curl -s "https://developerknowledge.googleapis.com/v1/documents/docs.cloud.google.com/run/docs/overview/what-is-cloud-run?key=${DEVELOPERKNOWLEDGE_API_KEY}" - Batch Get Documents:
bash
curl -s -X POST "https://developerknowledge.googleapis.com/v1/documents:batchGet?key=${DEVELOPERKNOWLEDGE_API_KEY}" \ -H "Content-Type: application/json" \ -d '{"names": ["documents/docs.cloud.google.com/run/docs/overview/what-is-cloud-run"]}'
Synthesis & Output Guidelines
整合与输出指南
- Grounding in Official Documentation: Ground all solutions directly in retrieved documentation. Official documentation conventions have absolute precedence over memorized defaults.
- Exact Parameter Formatting: Format CLI flags, composite keys (e.g. ), and IAM permission strings according to official Google specifications.
location=IP:PATH - Complete Solutions in Final Response: Always output the full, self-contained, executable technical solution (commands, configurations, or code snippets) with clear standard placeholders (e.g. ,
PROJECT_ID,SERVICE_NAME) directly in your final message, even if previously referenced during internal planning.REGION
- 基于官方文档:所有解决方案均需直接基于检索到的文档。官方文档约定优先于记忆中的默认内容。
- 精确参数格式:按照谷歌官方规范格式化CLI标志、复合键(例如)及IAM权限字符串。
location=IP:PATH - 在最终回复中输出完整解决方案:始终在最终消息中输出完整、独立且可执行的技术解决方案(命令、配置或代码片段),并使用清晰的标准占位符(例如、
PROJECT_ID、SERVICE_NAME),即使在内部规划阶段已提及相关内容。REGION
References
参考资料
- MCP Usage & Tool Details
- REST API Fallback Guide
- Supported Domains & Scoping
- MCP使用与工具详情
- REST API备选方案指南
- 支持的域名与范围