MCP Tools Reference: people.googleapis.com

工具:get_user_profile

获取您自己的个人资料信息(姓名和邮箱)。

以下代码示例展示了如何使用 curl 调用 get_user_profile MCP 工具。

Curl 请求
curl --location 'https://people.googleapis.com/mcp/v1' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
--header 'content-type: application/json' \
--header 'accept: application/json, text/event-stream' \
--data '{
  "method": "tools/call",
  "params": {
    "name": "get_user_profile",
    "arguments": {
      // Provide these details according to the MCP tool specification.
    }
  },
  "jsonrpc": "2.0",
  "id": 1
}'

输入架构

GetUserProfile 的请求消息。

输出架构

GetUserProfile 的响应消息。

GetUserProfileResponse

JSON 表示法
{
  "name": string,
  "emailAddress": string
}
字段
name

string

用户的显示名称。

emailAddress

string

用户的账号邮箱。

工具注释

工具注解会发送到 MCP 客户端,用于描述给定工具的基本风险。大多数客户端会将这些提示视为不可信,但它们可用于决定何时向用户发送确认提示。

除了标题字符串之外,还定义了以下布尔值提示:

  • readOnlyHint:如果为 true,则该工具不会修改其环境。默认值:false。
  • destructiveHint:如果为 true,则该工具可以执行破坏性操作。如果为 false,则该工具只能执行添加操作。默认值:true。
  • idempotentHint:如果为 true,则使用相同参数重复调用该工具不会对其环境产生额外影响。默认值:false。
  • openWorldHint:如果为 true,则该工具可以与外部实体的“开放世界”进行交互。如果为 false,则该工具只能与内部实体交互。例如,网页搜索工具是开放式的,而记忆工具不是开放式的。

破坏性提示:❌ | 等幂性提示:✅ | 只读提示:✅ | 开放世界提示:❌

授权范围

需要以下 OAuth 范围之一:

  • https://www.googleapis.com/auth/userinfo.profile