Skip to main content
Glama
Qihoo360

360 AI Cloud Drive MCP Server

by Qihoo360

user-info

Retrieve detailed user account information from 360 AI Cloud Drive for authentication and account management purposes.

Instructions

获取360AI云盘用户详细信息。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Main execution logic for the 'user-info' tool: authenticates, fetches user data from API, formats storage and VIP info, returns formatted text response.
      async (mcpReq: any) => {
        const httpContext = gethttpContext(mcpReq, server);
        
        // 使用transport中的authInfo
        const transportAuthInfo = httpContext.authInfo;
        console.error('transportAuthInfo==user-info', transportAuthInfo);
        try {
          let authInfo: AuthInfo;
          try {
            // 传入方法名和qid参数
            authInfo = await getAuthInfo({}, transportAuthInfo);
            authInfo.request_url = getConfig(transportAuthInfo?.ecsEnv).request_url
          } catch (authError) {
            throw new Error("获取鉴权信息失败,请提供有效的API_KEY");
          }
    
          // 调用API获取用户信息
          const apiResponse = await fetchUserInfo(authInfo);
    
          // 检查API响应是否成功
          if (apiResponse && apiResponse.errno === 0 && apiResponse.data) {
            const user = apiResponse.data;
            // 格式化部分关键信息
            const info = [
              `昵称: ${user.name}`,
              `会员: ${user.is_vip ? '是' : '否'}${user.vip_desc ? '(' + user.vip_desc + ')' : ''}`,
              `总空间: ${(parseInt(user.total_size) / (1024 * 1024 * 1024)).toFixed(2)} GB`,
              `已用空间: ${(parseInt(user.used_size) / (1024 * 1024 * 1024)).toFixed(2)} GB`,
              `剩余空间: ${(user.available_size / (1024 * 1024 * 1024)).toFixed(2)} GB`,
              `会员剩余天数: ${user.expire_day}天`,
              `会员到期时间: ${user.expire ? new Date(parseInt(user.expire) * 1000).toLocaleString() : '未知'}`
            ].join('\n');
            return {
              content: [
                {
                  type: "text",
                  text: `用户信息获取成功!\n${info}`,
                },
              ],
              userInfo: user
            };
          } else {
            const errorMsg = apiResponse?.errmsg || "API请求失败";
            throw new Error(errorMsg);
          }
        } catch (error: any) {
          console.error("获取用户信息出错:", error);
          return {
            content: [
              {
                type: "text",
                text: `获取用户信息时发生错误: ${error.message}`,
              },
              {
                type: "text",
                text: TOOL_LIMIT_NOTE,
              },
            ],
          };
        }
      },
    );
  • Registers the 'user-info' tool on the MCP server using server.tool(), defining name, description, and handler.
    export function registerUserInfoTool(server: McpServer) {
      server.tool(
        "user-info",
        "获取360AI云盘用户详细信息。",
        async (mcpReq: any) => {
          const httpContext = gethttpContext(mcpReq, server);
          
          // 使用transport中的authInfo
          const transportAuthInfo = httpContext.authInfo;
          console.error('transportAuthInfo==user-info', transportAuthInfo);
          try {
            let authInfo: AuthInfo;
            try {
              // 传入方法名和qid参数
              authInfo = await getAuthInfo({}, transportAuthInfo);
              authInfo.request_url = getConfig(transportAuthInfo?.ecsEnv).request_url
            } catch (authError) {
              throw new Error("获取鉴权信息失败,请提供有效的API_KEY");
            }
    
            // 调用API获取用户信息
            const apiResponse = await fetchUserInfo(authInfo);
    
            // 检查API响应是否成功
            if (apiResponse && apiResponse.errno === 0 && apiResponse.data) {
              const user = apiResponse.data;
              // 格式化部分关键信息
              const info = [
                `昵称: ${user.name}`,
                `会员: ${user.is_vip ? '是' : '否'}${user.vip_desc ? '(' + user.vip_desc + ')' : ''}`,
                `总空间: ${(parseInt(user.total_size) / (1024 * 1024 * 1024)).toFixed(2)} GB`,
                `已用空间: ${(parseInt(user.used_size) / (1024 * 1024 * 1024)).toFixed(2)} GB`,
                `剩余空间: ${(user.available_size / (1024 * 1024 * 1024)).toFixed(2)} GB`,
                `会员剩余天数: ${user.expire_day}天`,
                `会员到期时间: ${user.expire ? new Date(parseInt(user.expire) * 1000).toLocaleString() : '未知'}`
              ].join('\n');
              return {
                content: [
                  {
                    type: "text",
                    text: `用户信息获取成功!\n${info}`,
                  },
                ],
                userInfo: user
              };
            } else {
              const errorMsg = apiResponse?.errmsg || "API请求失败";
              throw new Error(errorMsg);
            }
          } catch (error: any) {
            console.error("获取用户信息出错:", error);
            return {
              content: [
                {
                  type: "text",
                  text: `获取用户信息时发生错误: ${error.message}`,
                },
                {
                  type: "text",
                  text: TOOL_LIMIT_NOTE,
                },
              ],
            };
          }
        },
      );
    }
  • Helper function to fetch raw user information from the 360AI cloud disk API using GET request with auth params.
    async function fetchUserInfo(authInfo: AuthInfo): Promise<any> {
      try {
        const url = new URL(authInfo.request_url || '');
    
        // 构建请求头
        const headers = {
          'Access-Token': authInfo.access_token || ''
        };
    
        // 构建请求参数
        const baseParams: Record<string, string> = {
          'method': 'User.getUserDetail',
          'access_token': authInfo.access_token || '',
          'qid': authInfo.qid || '',
          'sign': ''
        };
    
        // 添加所有参数到URL
        Object.entries(baseParams).forEach(([key, value]) => {
          url.searchParams.append(key, String(value));
        });
    
        const response = await fetch(url.toString(), {
          method: 'GET',
          headers: headers
        });
    
        if (!response.ok) {
          throw new Error(`API 请求失败,状态码: ${response.status}`);
        }
    
        // 获取原始响应文本
        const responseText = await response.text();
    
        try {
          // 尝试解析为JSON
          const data = JSON.parse(responseText);
          return data;
        } catch (jsonError) {
          console.error("JSON解析错误:", jsonError);
          throw new Error(`无法解析API响应: ${responseText.substring(0, 100)}...`);
        }
      } catch (error) {
        console.error('获取用户信息失败:', error);
        throw error;
      }
    }
  • Invokes registerUserInfoTool to register the tool as part of all tools registration.
    registerUserInfoTool(server);
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states it retrieves user details but doesn't specify what details are included, whether it requires authentication, rate limits, or error conditions. This is a significant gap for a tool with zero annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence in Chinese that directly states the tool's purpose without any wasted words. It is appropriately sized and front-loaded, making it easy to parse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations and no output schema, the description is incomplete. It doesn't explain what user details are returned, the format of the response, or any behavioral aspects like authentication needs. For a tool that likely involves sensitive user data, this is inadequate.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters with 100% schema description coverage (since there are no parameters). The description doesn't need to add parameter details, so it meets the baseline of 4 for tools with no parameters, as it doesn't have to compensate for any gaps.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('获取' meaning 'get' or 'retrieve') and resource ('360AI云盘用户详细信息' meaning '360AI cloud disk user detailed information'), providing a specific purpose. However, it doesn't differentiate from sibling tools like 'file-list' or 'file-search' which might also involve user information indirectly, so it doesn't reach the highest score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention prerequisites, context, or exclusions, leaving the agent to infer usage based on the tool name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/Qihoo360/ecs_mcp_server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server